public function search($params) { $query = Reminders::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'event_id' => $this->event_id, 'offset' => $this->offset, 'time' => $this->time, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]); $query->andFilterWhere(['like', 'title', $this->title]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getReminders() { return $this->hasMany(Reminders::className(), ['event_id' => 'id']); }
/** * Finds the Reminders model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Reminders the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Reminders::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }