mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-12 11:40:19 +08:00
ensure populateRelation() is called for lazy loading.
This commit is contained in:
@@ -238,7 +238,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
|
|||||||
throw new InvalidParamException('Relation names are case sensitive. ' . get_class($this) . " has a relation named \"$realName\" instead of \"$name\".");
|
throw new InvalidParamException('Relation names are case sensitive. ' . get_class($this) . " has a relation named \"$realName\" instead of \"$name\".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->_related[$name] = $value->multiple ? $value->all() : $value->one();
|
$this->populateRelation($name, $value->multiple ? $value->all() : $value->one());
|
||||||
|
return $this->_related[$name];
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user