Exemplo n.º 1
0
 public function search($params)
 {
     /*[5.1] JOIN TABLE */
     $query = Jabatan::find();
     $dataProvider_Jab = new ActiveDataProvider(['query' => $query]);
     /*[5.3] LOAD VALIDATION PARAMS */
     /*LOAD FARM VER 1*/
     $this->load($params);
     if (!$this->validate()) {
         return $dataProvider_Jab;
     }
     /*[5.4] FILTER WHERE LIKE (string/integer)*/
     /* FILTER COLUMN Author -ptr.nov-*/
     $query->andFilterWhere(['like', 'JAB_ID', $this->JAB_ID])->andFilterWhere(['like', 'JAB_NM', $this->JAB_NM]);
     return $dataProvider_Jab;
 }
Exemplo n.º 2
0
 /**
  * CLASS TABLE FIND PrimaryKey
  * Example:  Employe::find()
  */
 protected function findModel($id)
 {
     if (($model = Jabatan::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }