Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Edocument::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'doc_date' => $this->doc_date, 'sender' => $this->sender, 'receive' => $this->receive, 'datetime' => $this->datetime, 'doc_status' => $this->doc_status, 'piority' => $this->piority, 'get_doc' => $this->get_doc, 'loaded' => $this->loaded]);
     $query->andFilterWhere(['like', 'doc_no', $this->doc_no])->andFilterWhere(['like', 'subject', $this->subject])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'filename', $this->filename])->andFilterWhere(['like', 'ref', $this->ref]);
     return $dataProvider;
 }
Example #2
0
 /**
  * Finds the Edocument model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Edocument the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Edocument::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEdocuments()
 {
     return $this->hasMany(Edocument::className(), ['sender' => 'id']);
 }