This commit is contained in:
as2252258@163.com
2021-04-24 20:29:40 +08:00
parent fb4b9f4a24
commit f29f904e7d
+3 -4
View File
@@ -134,14 +134,13 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/
public function init()
{
$this->event = Snowflake::app()->getEvent();
if (!Context::hasContext(Relation::class)) {
$relation = Snowflake::createObject(Relation::class);
$this->_relation = Context::setContext(Relation::class, $relation);
} else {
$this->_relation = Context::getContext(Relation::class);
}
// $this->createAnnotation();
$this->createAnnotation();
}
@@ -150,8 +149,8 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/
public function createAnnotation()
{
// $annotation = Snowflake::getAnnotation();
// $annotation->injectProperty($this);
$annotation = Snowflake::getAnnotation();
$annotation->injectProperty($this);
// $methods = $annotation->getMethods(get_called_class());
// foreach ($methods as $method => $attributes) {
// foreach ($attributes as $attribute) {