yii2-relation-trait icon indicating copy to clipboard operation
yii2-relation-trait copied to clipboard

$this->relatedRecords is empty

Open ilbassa opened this issue 5 years ago • 1 comments

Hi, I'm trying to retrieve releted data with $model->getAttributesWithRelated() but the result is empty. In the method there is a foreach ($this->relatedRecords as $name => $records) { but I don't find where relatedRecords is set....

I'm calling getAttributesWithRelated() on a model retrieved by a find()->one()

ilbassa avatar Mar 10 '20 15:03 ilbassa

https://www.yiiframework.com/doc/api/2.0/yii-db-baseactiverecord#$relatedRecords-detail

demonking avatar Jun 04 '20 13:06 demonking