This commit is contained in:
2021-10-19 18:42:04 +08:00
parent a0113b4baa
commit 6faf3daf0a
+1 -20
View File
@@ -104,13 +104,6 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
protected array $rules = []; protected array $rules = [];
/**
* @var Relation|null
*/
#[Inject(Relation::class)]
protected ?Relation $_relation;
/** /**
* @var array * @var array
*/ */
@@ -221,15 +214,6 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
} }
/**
* @param Relation $relation
*/
public function setRelation(Relation $relation)
{
$this->_relation = $relation;
}
/** /**
* @throws Exception * @throws Exception
*/ */
@@ -237,9 +221,6 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
{ {
$an = Kiri::app()->getAnnotation(); $an = Kiri::app()->getAnnotation();
$an->injectProperty($this); $an->injectProperty($this);
var_dump($this->_relation);
} }
@@ -786,7 +767,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
*/ */
public function getRelation(): ?Relation public function getRelation(): ?Relation
{ {
return $this->_relation; return Kiri::getDi()->get(Relation::class);
} }