This commit is contained in:
as2252258@163.com
2021-04-24 19:48:42 +08:00
parent 1867083b14
commit 0077948d12
2 changed files with 13 additions and 3 deletions
+3 -3
View File
@@ -732,10 +732,10 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/
public function getRelate($name): mixed
{
if (!isset($this->_relate[$name])) {
return NULL;
if (empty($this->_relate[$name])) {
$this->_relate = Snowflake::getAnnotation()->getRelateMethods(get_called_class());
}
return $this->_relate[$name];
return $this->_relate[$name] ?? null;
}