This commit is contained in:
2021-04-27 18:57:25 +08:00
parent 55acb2795f
commit b294d0fbde
2 changed files with 4 additions and 5 deletions
+3 -5
View File
@@ -168,14 +168,12 @@ class ActiveRecord extends BaseActiveRecord
* @return static * @return static
* @throws Exception * @throws Exception
*/ */
#[Pure] private static function getModelClass(): static private static function getModelClass(): static
{ {
return new static();
$className = get_called_class();
/** @var Channel $channel */ /** @var Channel $channel */
$channel = Snowflake::app()->get('channel'); $channel = Snowflake::app()->get('channel');
return $channel->pop($className, function () use ($className) { return $channel->pop(static::class, function () {
return new $className(); return new static();
}); });
} }
+1
View File
@@ -362,6 +362,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
/** /**
* @return array * @return array
* @throws Exception
*/ */
public function getAttributes(): array public function getAttributes(): array
{ {