/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = ATTENDANCE::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['ATTENDANCE_ID' => $this->ATTENDANCE_ID, 'MEMBER_ID' => $this->MEMBER_ID, 'MEETING_ID' => $this->MEETING_ID]);
     return $dataProvider;
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getATTENDANCEs()
 {
     return $this->hasMany(ATTENDANCE::className(), ['MEETING_ID' => 'MEETING_ID']);
 }
 /**
  * Finds the ATTENDANCE model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $ATTENDANCE_ID
  * @param integer $MEMBER_ID
  * @return ATTENDANCE the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($ATTENDANCE_ID, $MEMBER_ID)
 {
     if (($model = ATTENDANCE::findOne(['ATTENDANCE_ID' => $ATTENDANCE_ID, 'MEMBER_ID' => $MEMBER_ID])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }