改名
This commit is contained in:
@@ -28,6 +28,7 @@ use ReflectionException;
|
|||||||
use Snowflake\Abstracts\Component;
|
use Snowflake\Abstracts\Component;
|
||||||
use Snowflake\Abstracts\Config;
|
use Snowflake\Abstracts\Config;
|
||||||
use Snowflake\Abstracts\TraitApplication;
|
use Snowflake\Abstracts\TraitApplication;
|
||||||
|
use Snowflake\Application;
|
||||||
use Snowflake\Exception\ConfigException;
|
use Snowflake\Exception\ConfigException;
|
||||||
use Snowflake\Exception\NotFindClassException;
|
use Snowflake\Exception\NotFindClassException;
|
||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
@@ -73,6 +74,9 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
|||||||
private array $_annotations = [];
|
private array $_annotations = [];
|
||||||
|
|
||||||
|
|
||||||
|
protected ?Application $container;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
@@ -125,6 +129,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
$this->container = Snowflake::app();
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user