/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Caja::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(['idCaja' => $this->idCaja, 'TipoCaja_idTipoCaja' => $this->TipoCaja_idTipoCaja, 'physic' => $this->physic]);
     return $dataProvider;
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCajas()
 {
     return $this->hasMany(Caja::className(), ['TipoCaja_idTipoCaja' => 'idTipoCaja']);
 }
Example #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCajaIdCajas()
 {
     return $this->hasMany(Caja::className(), ['idCaja' => 'Caja_idCaja'])->viaTable('pallet_has_caja', ['Pallet_idPallet' => 'idPallet']);
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCajas()
 {
     return $this->hasMany(Caja::className(), ['physic' => 'id']);
 }
Example #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCajaIdCajas()
 {
     return $this->hasMany(Caja::className(), ['idCaja' => 'Caja_idCaja'])->viaTable('estante_has_caja', ['Estante_idEstante' => 'idEstante']);
 }
 /**
  * Finds the Caja model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $idCaja
  * @param integer $TipoCaja_idTipoCaja
  * @return Caja the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($idCaja, $TipoCaja_idTipoCaja)
 {
     if (($model = Caja::findOne(['idCaja' => $idCaja, 'TipoCaja_idTipoCaja' => $TipoCaja_idTipoCaja])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCajaIdCaja()
 {
     return $this->hasOne(Caja::className(), ['idCaja' => 'Caja_idCaja']);
 }