Esempio n. 1
0
 public function getFavouriteCountries()
 {
     return $this->hasMany(\backend\models\Countries::className(), ['id' => 'country_name'])->viaTable('travellers_countries', ['traveller_id' => 'id'], function ($query) {
         return $query->where('travellers_countries.country_description = "favourite_country"');
     });
 }