This commit is contained in:
2021-03-29 17:05:28 +08:00
parent e9f82e59cc
commit df67a47bb5
2 changed files with 5 additions and 1 deletions
-1
View File
@@ -164,7 +164,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
$attribute->execute([$this, $method]); $attribute->execute([$this, $method]);
} }
} }
$annotation->injectProperty($this);
} }
+5
View File
@@ -14,6 +14,7 @@ use Exception;
use JetBrains\PhpStorm\Pure; use JetBrains\PhpStorm\Pure;
use Snowflake\Snowflake; use Snowflake\Snowflake;
use Swoole\Coroutine; use Swoole\Coroutine;
use function Amp\any;
/** /**
* Class BaseObject * Class BaseObject
@@ -29,6 +30,7 @@ class BaseObject implements Configure
* BaseAbstract constructor. * BaseAbstract constructor.
* *
* @param array $config * @param array $config
* @throws Exception
*/ */
public function __construct($config = []) public function __construct($config = [])
{ {
@@ -36,6 +38,9 @@ class BaseObject implements Configure
Snowflake::configure($this, $config); Snowflake::configure($this, $config);
} }
$this->init(); $this->init();
if (Snowflake::app()->has('attributes')) {
annotation()->injectProperty($this);
}
} }