diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 866c8599..fe57a769 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -164,7 +164,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess $attribute->execute([$this, $method]); } } - $annotation->injectProperty($this); } diff --git a/System/Abstracts/BaseObject.php b/System/Abstracts/BaseObject.php index 639ac53e..05ae15e7 100644 --- a/System/Abstracts/BaseObject.php +++ b/System/Abstracts/BaseObject.php @@ -14,6 +14,7 @@ use Exception; use JetBrains\PhpStorm\Pure; use Snowflake\Snowflake; use Swoole\Coroutine; +use function Amp\any; /** * Class BaseObject @@ -29,6 +30,7 @@ class BaseObject implements Configure * BaseAbstract constructor. * * @param array $config + * @throws Exception */ public function __construct($config = []) { @@ -36,6 +38,9 @@ class BaseObject implements Configure Snowflake::configure($this, $config); } $this->init(); + if (Snowflake::app()->has('attributes')) { + annotation()->injectProperty($this); + } }