This commit is contained in:
2021-03-04 14:24:45 +08:00
parent a7e0f306d2
commit cc91115514
3 changed files with 60 additions and 4 deletions
+14 -1
View File
@@ -11,7 +11,6 @@ namespace Database\Base;
use Annotation\Event;
use Annotation\IAnnotation;
use Annotation\Inject;
use Annotation\Model\Get;
use Annotation\Model\Set;
@@ -55,6 +54,9 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
protected ?SEvent $event;
protected array $_with = [];
/** @var array */
protected array $_attributes = [];
@@ -658,6 +660,17 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
$this->_relate[$name] = $value;
}
/**
* @param $name
* @return bool
*/
public function hasRelate($name): bool
{
return isset($this->_relate[$name]);
}
/**
* @param array $relates
*/