示例#1
0
 public function getCity()
 {
     return $this->hasOne(City::className(), ['id' => 'city_id'])->via('hotel');
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCities()
 {
     return $this->hasMany(City::className(), ['country_id' => 'id']);
 }