Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

yii2 has many where

public function getImages()
{
    return $this->hasMany(RecipeImage::className(), ['imageable_id' => 'id'])
        ->andOnCondition(['imageable_type' => 'Person']);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
8+2 =