/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = EfMenuSub::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(['MENU_SUB_ID' => $this->MENU_SUB_ID, 'MENU_MAIN_ID' => $this->MENU_MAIN_ID, 'SEQ' => $this->SEQ, 'CREATE_BY' => $this->CREATE_BY, 'CREATE_DATE' => $this->CREATE_DATE, 'LAST_UPD_BY' => $this->LAST_UPD_BY, 'LAST_UPD_DATE' => $this->LAST_UPD_DATE]); $query->andFilterWhere(['like', 'MENU_SUB_NAME', $this->MENU_SUB_NAME])->andFilterWhere(['like', 'DESCRIPTION', $this->DESCRIPTION])->andFilterWhere(['like', 'MENU_LINK', $this->MENU_LINK])->andFilterWhere(['like', 'STATUS', $this->STATUS]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getMENUSUB() { return $this->hasOne(EfMenuSub::className(), ['MENU_SUB_ID' => 'MENU_SUB_ID']); }
/** * Finds the EfMenuSub model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return EfMenuSub the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = EfMenuSub::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getEfMenuSubs() { return $this->hasMany(EfMenuSub::className(), ['MENU_MAIN_ID' => 'MENU_MAIN_ID']); }