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