Ejemplo n.º 1
0
 /**
  * Finds the Berita model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $ID
  * @return Berita the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($ID)
 {
     if (($model = Berita::findOne(['ID' => $ID])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 2
0
 public function searchBeritaClose($params)
 {
     $query = Berita::find()->where('STATUS<>1');
     $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, 'STATUS' => $this->STATUS, 'CREATED_ATCREATED_BY' => $this->CREATE_AT, 'UPDATE_AT' => $this->UPDATE_AT]);
     $query->andFilterWhere(['like', 'KD_BERITA', $this->KD_BERITA])->andFilterWhere(['like', 'JUDUL', $this->JUDUL])->andFilterWhere(['like', 'ISI', $this->ISI])->andFilterWhere(['like', 'KD_CORP', $this->corphistory])->andFilterWhere(['like', 'KD_CAB', $this->KD_CAB])->andFilterWhere(['like', 'KD_DEP', $this->depthistory])->andFilterWhere(['like', 'DATA_PICT', $this->DATA_PICT])->andFilterWhere(['like', 'DATA_FILE', $this->DATA_FILE])->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])->andFilterWhere(['like', 'DATA_ALL', $this->DATA_ALL]);
     return $dataProvider;
 }