改名
This commit is contained in:
@@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||||||
namespace Database\Base;
|
namespace Database\Base;
|
||||||
|
|
||||||
|
|
||||||
|
use HttpServer\Http\Context;
|
||||||
use Snowflake\Abstracts\Component;
|
use Snowflake\Abstracts\Component;
|
||||||
use Snowflake\Core\JSON;
|
use Snowflake\Core\JSON;
|
||||||
use Database\ActiveQuery;
|
use Database\ActiveQuery;
|
||||||
@@ -57,15 +58,19 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
|
|||||||
|
|
||||||
protected array $actions = [];
|
protected array $actions = [];
|
||||||
|
|
||||||
/** @var Relation */
|
protected ?Relation $_relation;
|
||||||
protected $_relation = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->_relation = Snowflake::createObject(Relation::className());
|
if (!Context::hasContext(Relation::class)) {
|
||||||
|
$relation = Snowflake::createObject(Relation::class);
|
||||||
|
$this->_relation = Context::setContext(Relation::class, $relation);
|
||||||
|
} else {
|
||||||
|
$this->_relation = Context::getContext(Relation::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user