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() public function init()
{ {
$this->event = Snowflake::app()->getEvent();
if (!Context::hasContext(Relation::class)) { if (!Context::hasContext(Relation::class)) {
$relation = Snowflake::createObject(Relation::class); $relation = Snowflake::createObject(Relation::class);
$this->_relation = Context::setContext(Relation::class, $relation); $this->_relation = Context::setContext(Relation::class, $relation);
} else { } else {
$this->_relation = Context::getContext(Relation::class); $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() public function createAnnotation()
{ {
// $annotation = Snowflake::getAnnotation(); $annotation = Snowflake::getAnnotation();
// $annotation->injectProperty($this); $annotation->injectProperty($this);
// $methods = $annotation->getMethods(get_called_class()); // $methods = $annotation->getMethods(get_called_class());
// foreach ($methods as $method => $attributes) { // foreach ($methods as $method => $attributes) {
// foreach ($attributes as $attribute) { // foreach ($attributes as $attribute) {