Yii2 Has Many Where

[Solved] Yii2 Has Many Where | Php Frameworks Yii - Code Explorer | yomemimo.com
Question : yii2 has many where

Answered by : rusik

public function getImages()
{ return $this->hasMany(RecipeImage::className(), ['imageable_id' => 'id']) ->andOnCondition(['imageable_type' => 'Person']);
}

Source : https://stackoverflow.com/questions/30503341/how-to-use-constant-in-the-on-condition-in-yii2-hasmany-relation | Last Update : Wed, 25 May 22

Answers related to yii2 has many where

Code Explorer Popular Question For Php Frameworks Yii