/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = ProductSpecification::find(); $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 // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['like', '_id', $this->_id])->andFilterWhere(['like', 'product_specification_id', $this->product_specification_id])->andFilterWhere(['like', 'product_specification_name', $this->product_specification_name])->andFilterWhere(['like', 'product_specification_tag', $this->product_specification_tag])->andFilterWhere(['like', 'product_specification_prefix', $this->product_specification_prefix])->andFilterWhere(['like', 'product_specification_value_price', $this->product_specification_value_price])->andFilterWhere(['like', 'product_specification_create_date', $this->product_specification_create_date])->andFilterWhere(['like', 'product_specification_create_user_id', $this->product_specification_create_user_id])->andFilterWhere(['like', 'product_specification_last_update_date', $this->product_specification_last_update_date])->andFilterWhere(['like', 'product_specification_last_update_user_id', $this->product_specification_last_update_user_id])->andFilterWhere(['like', 'product_specification_status', $this->product_specification_status])->andFilterWhere(['like', 'merchant_brand_fk', $this->merchant_brand_fk]); return $dataProvider; }
/** * Finds the ProductSpecification model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $_id * @return ProductSpecification the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = ProductSpecification::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }