/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = OlEngagement::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 return $dataProvider; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'congress_id' => $this->congress_id, 'meeting_id' => $this->meeting_id, 'ol_date' => $this->ol_date, 'ol_start_time' => $this->ol_start_time, 'ol_end_time' => $this->ol_end_time, 'attendee_id' => $this->attendee_id, 'ol_attendee_id' => $this->ol_attendee_id, 'ol_profile_id' => $this->ol_profile_id, 'meeting_approval' => $this->meeting_approval, 'rsr' => $this->rsr, 'ol_consultant' => $this->ol_consultant, 'created_on' => $this->created_on, 'is_active' => $this->is_active]); $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'location', $this->location])->andFilterWhere(['like', 'ol_catering', $this->ol_catering])->andFilterWhere(['like', 'notes', $this->notes]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getOlEngagements() { return $this->hasMany(OlEngagement::className(), ['ol_profile_id' => 'id']); }
/** * Finds the OlEngagement model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return OlEngagement the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = OlEngagement::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getOlEngagements() { return $this->hasMany(OlEngagement::className(), ['meeting_id' => 'id']); }