/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = EstanteHasCaja::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['Estante_idEstante' => $this->Estante_idEstante, 'Caja_idCaja' => $this->Caja_idCaja]); return $dataProvider; }
/** * Finds the EstanteHasCaja model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $Estante_idEstante * @param integer $Caja_idCaja * @return EstanteHasCaja the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($Estante_idEstante, $Caja_idCaja) { if (($model = EstanteHasCaja::findOne(['Estante_idEstante' => $Estante_idEstante, 'Caja_idCaja' => $Caja_idCaja])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getEstanteHasCajas() { return $this->hasMany(EstanteHasCaja::className(), ['Estante_idEstante' => 'idEstante']); }
/** * @return \yii\db\ActiveQuery */ public function getEstanteHasCajas() { return $this->hasMany(EstanteHasCaja::className(), ['Caja_idCaja' => 'idCaja', 'Caja_TipoCaja_idTipoCaja' => 'TipoCaja_idTipoCaja']); }