/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = NurseryForm::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, 'grade_protection' => $this->grade_protection, 'enrolled_id' => $this->enrolled_id, 'grading_period' => $this->grading_period, 'core_value_1' => $this->core_value_1, 'core_value_2' => $this->core_value_2, 'core_value_3' => $this->core_value_3, 'core_value_4' => $this->core_value_4, 'subject_1' => $this->subject_1, 'subject_2' => $this->subject_2, 'subject_3' => $this->subject_3, 'subject_4' => $this->subject_4, 'subject_5' => $this->subject_5]); return $dataProvider; }
protected function findModel($id) { if (($model = NurseryForm::findOne($id)) !== null) { return $model; } elseif (($model = KinderOneForm::findOne($id)) !== null) { return $model; } elseif (($model = KinderTwoForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeOneForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeTwoForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeThreeForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeFourForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeFiveForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeSixForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeSevenForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeEightForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeNineForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeTenForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeElevenFirstSemForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeElevenSecondSemForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeTwelveFirstSemForm::findOne($id)) !== null) { return $model; } elseif (($model = GradeTwelveSecondSemForm::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Finds the NurseryForm model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return NurseryForm the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = NurseryForm::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }