diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 18c55f35..815e2fae 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -168,14 +168,12 @@ class ActiveRecord extends BaseActiveRecord * @return static * @throws Exception */ - #[Pure] private static function getModelClass(): static + private static function getModelClass(): static { - return new static(); - $className = get_called_class(); /** @var Channel $channel */ $channel = Snowflake::app()->get('channel'); - return $channel->pop($className, function () use ($className) { - return new $className(); + return $channel->pop(static::class, function () { + return new static(); }); } diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index ca436fe0..34b8d796 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -362,6 +362,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess /** * @return array + * @throws Exception */ public function getAttributes(): array {