/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Compile::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([ 'compile_id' => $this->compile_id, 'compile_scholar_id' => $this->compile_scholar_id, 'compile_school_id' => $this->compile_school_id, 'compile_tuitionfee_id' => $this->compile_tuitionfee_id, 'compile_grade_id' => $this->compile_grade_id, ]); $query->andFilterWhere(['like', 'compile_scholar_firstName', $this->compile_scholar_firstName]) ->andFilterWhere(['like', 'compile_scholar_lastName', $this->compile_scholar_lastName]) ->andFilterWhere(['like', 'compile_scholar_middleName', $this->compile_scholar_middleName]) ->andFilterWhere(['like', 'compile_school_name', $this->compile_school_name]) ->andFilterWhere(['like', 'compile_school_area', $this->compile_school_area]) ->andFilterWhere(['like', 'compile_pendingPaymentToSchool', $this->compile_pendingPaymentToSchool]) ->andFilterWhere(['like', 'compile_pendingPaymentToStudent', $this->compile_pendingPaymentToStudent]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getCompiles() { return $this->hasMany(Compile::className(), ['compile_scholar_id' => 'scholar_id']); }
/** * Finds the Compile model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Compile the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Compile::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getCompiles() { return $this->hasMany(Compile::className(), ['compile_grade_id' => 'grade_id']); }