コード例 #1
0
ファイル: DocdbaSearch.php プロジェクト: adem-team/advanced
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Docdba::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' => $this->ID, 'PARENT' => $this->PARENT, 'CREATED_DATE' => $this->CREATED_DATE, 'STATUS' => $this->STATUS, 'USER_CREATED' => $this->USER_CREATED, 'SORT' => $this->SORT]);
     $query->andFilterWhere(['like', 'MDL_ID', $this->MDL_ID])->andFilterWhere(['like', 'MDL_NM', $this->MDL_NM])->andFilterWhere(['like', 'MDL_DB', $this->MDL_DB])->andFilterWhere(['like', 'MDL_DB_ALIAS', $this->MDL_DB_ALIAS])->andFilterWhere(['like', 'MDL_TBL', $this->MDL_TBL])->andFilterWhere(['like', 'MDL_KEY', $this->MDL_KEY])->andFilterWhere(['like', 'MDL_FLD', $this->MDL_FLD])->andFilterWhere(['like', 'MDL_CLS', $this->MDL_CLS])->andFilterWhere(['like', 'MDL_LINK', $this->MDL_LINK])->andFilterWhere(['like', 'DSCRP', $this->DSCRP])->andFilterWhere(['like', 'CORP_ID', $this->CORP_ID])->andFilterWhere(['like', 'DEP_ID', $this->DEP_ID]);
     $query->orderby(['SORT' => SORT_ASC]);
     return $dataProvider;
 }
コード例 #2
0
 /**
  * Finds the Docdba model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $ID
  * @param string $MDL_ID
  * @return Docdba the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($ID, $MDL_ID)
 {
     if (($model = Docdba::findOne(['ID' => $ID, 'MDL_ID' => $MDL_ID])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }