Exemplo n.º 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getHotelFk()
 {
     return $this->hasOne(Hotels::className(), ['id' => 'hotel_fk']);
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getHotelFks()
 {
     return $this->hasMany(Hotels::className(), ['id' => 'hotel_fk'])->viaTable('hotel_features', ['features_fk' => 'id']);
 }
Exemplo n.º 3
0
 /**
  * actionIndex
  * @param unknown $to
  */
 public function actionIndex($to)
 {
     $provider = new ActiveDataProvider(['query' => Hotels::find()->where(['to' => $to])->with(['hotelFeatures', 'hotelFeatures.featuresFk'])->asArray(), 'pagination' => ['pageSize' => 2]]);
     return $provider;
 }