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