Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Pembukuan_golongan::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(['GOL_ID' => $this->GOL_ID, 'PRICE' => $this->PRICE, 'STATUS' => $this->STATUS, 'CREATED_AT' => $this->CREATED_AT, 'UPDATED_TIME' => $this->UPDATED_TIME]);
     $query->andFilterWhere(['like', 'GOL_NM', $this->GOL_NM])->andFilterWhere(['like', 'GOL_KET', $this->GOL_KET])->andFilterWhere(['like', 'SRC', $this->SRC])->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])->andFilterWhere(['like', 'UPDATED_BY', $this->UPDATED_BY]);
     return $dataProvider;
 }
 /**
  * Finds the Pembukuan_golongan model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Pembukuan_golongan the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Pembukuan_golongan::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }