改名
This commit is contained in:
@@ -296,7 +296,7 @@ class ActiveRecord extends BaseActiveRecord
|
||||
private function runRelate(): array
|
||||
{
|
||||
$relates = [];
|
||||
if (empty($this->_with)) {
|
||||
if (empty($with = $this->getWith())) {
|
||||
return $relates;
|
||||
}
|
||||
foreach ($this->_with as $val) {
|
||||
@@ -305,6 +305,25 @@ class ActiveRecord extends BaseActiveRecord
|
||||
return $relates;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $data
|
||||
* @return ActiveRecord
|
||||
*/
|
||||
public function setWith($data): static
|
||||
{
|
||||
$this->_with = $data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
*/
|
||||
public function getWith(): array|null
|
||||
{
|
||||
return $this->_with;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $modelName
|
||||
|
||||
Reference in New Issue
Block a user