diff --git a/ActiveQuery.php b/ActiveQuery.php index b8c4bc2..247505f 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -52,7 +52,7 @@ class ActiveQuery extends Component implements ISqlBuilder $this->modelClass = $model; $this->builder = SqlBuilder::builder($this); - parent::__construct($config); + parent::__construct(); } diff --git a/Base/AbstractCollection.php b/Base/AbstractCollection.php index 5576f68..95d75aa 100644 --- a/Base/AbstractCollection.php +++ b/Base/AbstractCollection.php @@ -65,7 +65,7 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat $this->query = $query; $this->model = $model; - parent::__construct([]); + parent::__construct(); } diff --git a/Base/Model.php b/Base/Model.php index 3d0c8b4..05e7796 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -87,12 +87,11 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T /** - * @param array $config * @throws Exception */ - public function __construct(array $config = []) + public function __construct() { - parent::__construct($config); + parent::__construct(); $this->init(); } @@ -149,10 +148,10 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T /** * @throws Exception */ - public function init() + public function init(): void { - $an = Kiri::getDi()->get(Annotation::class); - $an->injectProperty($this); + $container = Kiri::getDi(); + $container->resolveProperties($container->getReflectionClass(get_called_class()), $this); } diff --git a/Connection.php b/Connection.php index f8a0f50..204d151 100644 --- a/Connection.php +++ b/Connection.php @@ -86,7 +86,7 @@ class Connection extends Component */ public function __construct(public EventProvider $eventProvider, public Pool $connections, public ContainerInterface $container, array $config = []) { - parent::__construct($config); + parent::__construct(); } diff --git a/Pagination.php b/Pagination.php index 02b3648..9ef6043 100644 --- a/Pagination.php +++ b/Pagination.php @@ -42,7 +42,7 @@ class Pagination extends Component */ public function __construct(ActiveQuery $activeQuery, array $config = []) { - parent::__construct($config); + parent::__construct(); $this->activeQuery = $activeQuery; }