/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Decisionsb22::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(['enterName' => $this->enterName]); $query->andFilterWhere(['like', 'b22_ada', $this->b22_ada])->andFilterWhere(['like', 'afm', $this->afm])->andFilterWhere(['like', 'afmType', $this->afmType])->andFilterWhere(['like', 'afmCountry', $this->afmCountry])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'noVATOrg', $this->noVATOrg])->andFilterWhere(['like', 'documentType', $this->documentType]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getDecisionsb22() { return $this->hasOne(Decisionsb22::className(), ['b22_ada' => 'ada']); }
/** * Finds the Decisionsb22 model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return Decisionsb22 the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Decisionsb22::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }