I have objects connected mano through the intermediate table.
class City{ /**
* @return \yii\db\ActiveQuery
*/
public function getReviews()
{
return $this->hasMany(Reviews::className(), ['id' => 'review_id'])
->viaTable('city_review', ['city_id' => 'id']);
}
}
And get review for city:
$reviews = $city2->getReviews()->all();
Question: How select reviews from reviews table, which are not in the table city_review?