public function search($params) { $query = Price::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'service_id' => $this->service_id, 'category_id' => $this->category_id, 'price' => $this->price]); return $dataProvider; }
protected function findModel($id) { if (($model = Price::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }