Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 protected function findModel($id)
 {
     if (($model = Price::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }