loggerFactory->get($className); } /** * 事务处理. * @throws Throwable */ protected function transaction(callable $callback) { return Db::transaction($callback); } /** * 检查资源是否存在(不存在则抛出异常). * @throws BusinessException */ protected function checkResourceExists(?object $resource, string $message = '资源不存在'): void { if (empty($resource)) { throw new BusinessException($message, BusinessException::RESOURCE_NOT_FOUND); } } }