Yii2 hasMany relation additional condition

51

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

Comments

Submit
0 Comments