/**
  * Finds the Sentitems model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $ID
  * @param integer $SequencePosition
  * @return Sentitems the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($ID, $SequencePosition)
 {
     if (($model = Sentitems::findOne(['ID' => $ID, 'SequencePosition' => $SequencePosition])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Beispiel #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Sentitems::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['UpdatedInDB' => $this->UpdatedInDB, 'InsertIntoDB' => $this->InsertIntoDB, 'SendingDateTime' => $this->SendingDateTime, 'DeliveryDateTime' => $this->DeliveryDateTime, 'Class' => $this->Class, 'ID' => $this->ID, 'SequencePosition' => $this->SequencePosition, 'StatusError' => $this->StatusError, 'TPMR' => $this->TPMR, 'RelativeValidity' => $this->RelativeValidity]);
     $query->andFilterWhere(['like', 'Text', $this->Text])->andFilterWhere(['like', 'DestinationNumber', $this->DestinationNumber])->andFilterWhere(['like', 'Coding', $this->Coding])->andFilterWhere(['like', 'UDH', $this->UDH])->andFilterWhere(['like', 'SMSCNumber', $this->SMSCNumber])->andFilterWhere(['like', 'TextDecoded', $this->TextDecoded])->andFilterWhere(['like', 'SenderID', $this->SenderID])->andFilterWhere(['like', 'Status', $this->Status])->andFilterWhere(['like', 'CreatorID', $this->CreatorID]);
     return $dataProvider;
 }