/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = College::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]); $query->andFilterWhere(['like', 'college_to_apply1', $this->college_to_apply1])->andFilterWhere(['like', 'college_to_apply2', $this->college_to_apply2])->andFilterWhere(['like', 'course_to_take1', $this->course_to_take1])->andFilterWhere(['like', 'course_to_take2', $this->course_to_take2]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = College::find(); // add conditions that should always apply here $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; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'university_id' => $this->university_id, 'establish' => $this->establish, 'statutory_body_id' => $this->statutory_body_id, 'important_links_id' => $this->important_links_id, 'download_links_id' => $this->download_links_id, 'is_featured' => $this->is_featured, 'created' => $this->created, 'modified' => $this->modified, 'status' => $this->status, 'college_image_id' => $this->college_image_id]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'website', $this->website])->andFilterWhere(['like', 'logo', $this->logo])->andFilterWhere(['like', 'banner', $this->banner]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getCollege0() { return $this->hasOne(College::className(), ['id' => 'college']); }
/** * Finds the College model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return College the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = College::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getColleges0() { return $this->hasMany(College::className(), ['college_to_apply2' => 'school_name']); }
/** * @return \yii\db\ActiveQuery */ public function getColleges0() { return $this->hasMany(College::className(), ['course_to_take2' => 'course_name']); }