コード例 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = PalletHasCaja::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(['Pallet_idPallet' => $this->Pallet_idPallet, 'Caja_idCaja' => $this->Caja_idCaja]);
     $query->andFilterWhere(['like', 'descript', $this->descript]);
     return $dataProvider;
 }
コード例 #2
0
 /**
  * Finds the PalletHasCaja model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $Pallet_idPallet
  * @param integer $Caja_idCaja
  * @return PalletHasCaja the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($Pallet_idPallet, $Caja_idCaja)
 {
     if (($model = PalletHasCaja::findOne(['Pallet_idPallet' => $Pallet_idPallet, 'Caja_idCaja' => $Caja_idCaja])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPalletHasCajas()
 {
     return $this->hasMany(PalletHasCaja::className(), ['Pallet_idPallet' => 'idPallet']);
 }
コード例 #4
0
ファイル: Caja.php プロジェクト: MatiasBartoluche/isunaji2014
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPalletHasCajas()
 {
     return $this->hasMany(PalletHasCaja::className(), ['Caja_idCaja' => 'idCaja', 'Caja_TipoCaja_idTipoCaja' => 'TipoCaja_idTipoCaja']);
 }