Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Ycsb::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['recordcount' => $this->recordcount, 'operationcount' => $this->operationcount, 'readallfields' => $this->readallfields, 'readproportion' => $this->readproportion, 'updateproportion' => $this->updateproportion, 'scanproportion' => $this->scanproportion, 'insertproportion' => $this->insertproportion, 'id' => $this->id]);
     $query->andFilterWhere(['like', 'requestdistribution', $this->requestdistribution]);
     return $dataProvider;
 }
Exemplo n.º 2
0
 /**
  * Finds the Ycsb model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Ycsb the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Ycsb::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }