modify
This commit is contained in:
@@ -81,6 +81,16 @@ class Annotation extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $class
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getRelateMethods(string $class): array
|
||||||
|
{
|
||||||
|
return $this->_model_relate[$class] ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $class
|
* @param string $class
|
||||||
|
|||||||
@@ -732,10 +732,10 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function getRelate($name): mixed
|
public function getRelate($name): mixed
|
||||||
{
|
{
|
||||||
if (!isset($this->_relate[$name])) {
|
if (empty($this->_relate[$name])) {
|
||||||
return NULL;
|
$this->_relate = Snowflake::getAnnotation()->getRelateMethods(get_called_class());
|
||||||
}
|
}
|
||||||
return $this->_relate[$name];
|
return $this->_relate[$name] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user