/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Estante::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(['idEstante' => $this->idEstante, 'EstanteEstado_idEstanteEstado' => $this->EstanteEstado_idEstanteEstado, 'loadlimit' => $this->loadlimit]);
     $query->andFilterWhere(['like', 'Fila', $this->Fila])->andFilterWhere(['like', 'Columna', $this->Columna])->andFilterWhere(['like', 'descript', $this->descript]);
     return $dataProvider;
 }
 /**
  * Finds the Estante model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $idEstante
  * @param integer $EstanteEstado_idEstanteEstado
  * @return Estante the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($idEstante, $EstanteEstado_idEstanteEstado)
 {
     if (($model = Estante::findOne(['idEstante' => $idEstante, 'EstanteEstado_idEstanteEstado' => $EstanteEstado_idEstanteEstado])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEstanteIdEstante()
 {
     return $this->hasOne(Estante::className(), ['idEstante' => 'Estante_idEstante']);
 }
예제 #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEstante()
 {
     return $this->hasOne(Estante::className(), ['loadlimit' => 'id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEstantes()
 {
     return $this->hasMany(Estante::className(), ['EstanteEstado_idEstanteEstado' => 'idEstanteEstado']);
 }