This commit is contained in:
2021-03-24 17:12:33 +08:00
parent efe9edf727
commit 68fd2746fd
+8
View File
@@ -26,6 +26,7 @@ use Database\HasOne;
use Database\Mysql\Columns;
use Database\Relation;
use Exception;
use Snowflake\Abstracts\TraitApplication;
use Snowflake\Exception\ComponentException;
use Snowflake\Exception\NotFindClassException;
use validator\Validator;
@@ -45,6 +46,10 @@ use Snowflake\Event as SEvent;
abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
{
use TraitApplication;
const AFTER_SAVE = 'after::save';
const BEFORE_SAVE = 'before::save';
@@ -848,6 +853,9 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
if (in_array($name, $this->_with)) {
return $this->with($name);
}
if (Snowflake::app()->has($name)) {
return Snowflake::app()->get($name);
}
return parent::__get($name);
}