Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Dfs::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'min_file_size' => $this->min_file_size, 'max_file_size' => $this->max_file_size, 'isDirectIO' => $this->isDirectIO, 'isSumClose' => $this->isSumClose, 'isSyncTest' => $this->isSyncTest, 'atime' => $this->atime]);
     $query->andFilterWhere(['like', 'type', $this->type])->andFilterWhere(['like', 'status', $this->status])->andFilterWhere(['like', 'summary', $this->summary])->andFilterWhere(['like', 'log', $this->log]);
     return $dataProvider;
 }
Example #2
0
 /**
  * Finds the Dfs model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Dfs the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Dfs::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }