/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = SccCase::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(['case_id' => $this->case_id, 'c_date_time' => $this->c_date_time, 'profile_id' => $this->profile_id, 'category_id' => $this->category_id, 'issue_id' => $this->issue_id]);
     $query->andFilterWhere(['like', 'casenumber', $this->casenumber]);
     return $dataProvider;
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCase()
 {
     return $this->hasOne(SccCase::className(), ['case_id' => 'case_id']);
 }
 /**
  * Finds the SccCase model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return SccCase the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = SccCase::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSccCases()
 {
     return $this->hasMany(SccCase::className(), ['category_id' => 'category_id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSccCases()
 {
     return $this->hasMany(SccCase::className(), ['profile_id' => 'profile_id']);
 }