diff --git a/Base/Model.php b/Base/Model.php index 74522f1..ced1d08 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -28,7 +28,7 @@ use Exception; use Kiri; use Kiri\Abstracts\Component; use Kiri\Annotation\Annotation; -use Kiri\Error\StdoutLogger; +use Kiri\Error\StdoutLoggerInterface; use Kiri\Exception\NotFindClassException; use Kiri\ToArray; use ReflectionException; @@ -240,7 +240,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T */ public function getLastError(): string { - $logger = Kiri::getDi()->get(StdoutLogger::class); + $logger = Kiri::getDi()->get(StdoutLoggerInterface::class); return $logger->getLastError('mysql'); } diff --git a/Model.php b/Model.php index aab5e8c..40d0db9 100644 --- a/Model.php +++ b/Model.php @@ -16,7 +16,7 @@ use Exception; use Kiri; use Kiri\Exception\NotFindClassException; use Kiri\ToArray; -use Kiri\Error\StdoutLogger; +use Kiri\Error\StdoutLoggerInterface; use ReflectionException; use Swoole\Coroutine; @@ -109,7 +109,7 @@ class Model extends Base\Model */ public static function findOrCreate(array $condition, array $attributes): bool|static { - $logger = Kiri::getDi()->get(StdoutLogger::class); + $logger = Kiri::getDi()->get(StdoutLoggerInterface::class); if (empty($attributes)) { return $logger->addError(FIND_OR_CREATE_MESSAGE, 'mysql'); } @@ -134,7 +134,7 @@ class Model extends Base\Model */ public static function createOrUpdate(array $condition, array $attributes = []): bool|static { - $logger = Kiri::getDi()->get(StdoutLogger::class); + $logger = Kiri::getDi()->get(StdoutLoggerInterface::class); if (empty($attributes)) { return $logger->addError(FIND_OR_CREATE_MESSAGE, 'mysql'); }