/** * @return \yii\db\ActiveQuery */ public function getHotelFk() { return $this->hasOne(Hotels::className(), ['id' => 'hotel_fk']); }
/** * @return \yii\db\ActiveQuery */ public function getHotelFks() { return $this->hasMany(Hotels::className(), ['id' => 'hotel_fk'])->viaTable('hotel_features', ['features_fk' => 'id']); }
/** * 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; }