mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-05 23:14:40 +01:00
Fixed yii\db\ActiveRecord::with() unable to use relation defined via attached behavior in case asArray is enabled
This commit is contained in:
@@ -162,7 +162,9 @@ trait ActiveQueryTrait
|
||||
{
|
||||
$primaryModel = reset($models);
|
||||
if (!$primaryModel instanceof ActiveRecordInterface) {
|
||||
$primaryModel = new $this->modelClass();
|
||||
/* @var $modelClass ActiveRecordInterface */
|
||||
$modelClass = $this->modelClass;
|
||||
$primaryModel = $modelClass::instance();
|
||||
}
|
||||
$relations = $this->normalizeRelations($primaryModel, $with);
|
||||
/* @var $relation ActiveQuery */
|
||||
|
||||
Reference in New Issue
Block a user