here is the code instead of the thousand code
var_dump($model-image); getting
object(common\models\Image)#2028 (9) { ["class"]=> NULL ["_attributes":"yii\db\BaseActiveRecord":private]=> array(13) { ["title_alt"]=> string(46) "Ложное обвинение (сериал)" ["path"]=> string(15) "serial/2016/10/" ["name"]=> string(10) "979247.jpg" ["for_home"]=> int(1) } } then do so
$img = array_filter($model->image, function($item) { return $item->for_home == 1; }); var_dump($img) am getting null why am i not getting an object? in $img