/** * Finds the SimpelPagu model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return SimpelPagu the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = SimpelPagu::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = SimpelPagu::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_pagu' => $this->id_pagu, 'tahun' => $this->tahun, 'alokasi_sub_mak' => $this->alokasi_sub_mak, 'alokasi_pra_revisi' => $this->alokasi_pra_revisi, 'kd_satker' => $this->kd_satker, 'nas_prog_id' => $this->nas_prog_id, 'nas_keg_id' => $this->nas_keg_id, 'kdoutput' => $this->kdoutput, 'kdsoutput' => $this->kdsoutput, 'kdkmpnen' => $this->kdkmpnen, 'kode_mak' => $this->kode_mak]); $query->andFilterWhere(['like', 'kdskmpnen', $this->kdskmpnen]); return $dataProvider; }