/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Hairdresser::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'logo_img', $this->logo_img])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'working_time', $this->working_time])->andFilterWhere(['like', 'delivery', $this->delivery])->andFilterWhere(['like', 'phone_1', $this->phone_1])->andFilterWhere(['like', 'phone_2', $this->phone_2])->andFilterWhere(['like', 'phone_3', $this->phone_3])->andFilterWhere(['like', 'slug', $this->slug])->andFilterWhere(['like', 'lat', $this->lat])->andFilterWhere(['like', 'lng', $this->lng]);
     return $dataProvider;
 }
 /**
  * Finds the Hairdresser model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Hairdresser the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Hairdresser::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }