Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = StockSplit::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(['id' => $this->id, 'create_uid' => $this->create_uid, 'create_date' => $this->create_date, 'write_date' => $this->write_date, 'write_uid' => $this->write_uid, 'date_done' => $this->date_done, 'location' => $this->location, 'date_order' => $this->date_order, 'picking_id' => $this->picking_id]);
     $query->andFilterWhere(['like', 'no', $this->no])->andFilterWhere(['like', 'notes', $this->notes])->andFilterWhere(['like', 'state', $this->state])->andFilterWhere(['like', 'stock_split_no', $this->stock_split_no]);
     return $dataProvider;
 }
Exemplo n.º 2
0
 /**
  * Finds the StockSplit model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return StockSplit the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = StockSplit::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStockSplit0()
 {
     return $this->hasOne(StockSplit::className(), ['id' => 'stock_split_id']);
 }