예제 #1
0
 protected function findModelVoluntario($id)
 {
     if (($model = Voluntario::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
예제 #2
0
 public function searchVoluntarios()
 {
     $query = Voluntario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     //$this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['evento_idevento' => $this->evento_idevento, 'voluntario_idvoluntario' => $this->voluntario_idvoluntario]);
     return $dataProvider;
 }
예제 #3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Voluntario::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idvoluntario' => $this->idvoluntario]);
     $query->andFilterWhere(['like', 'nome', $this->nome])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'cracha', $this->cracha])->andFilterWhere(['like', 'instituicao', $this->instituicao]);
     return $dataProvider;
 }
예제 #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getVoluntarioIdvoluntarios()
 {
     return $this->hasMany(Voluntario::className(), ['idvoluntario' => 'voluntario_idvoluntario'])->viaTable('itemprogramacao_has_voluntario', ['itemProgramacao_iditemProgramacao' => 'iditemProgramacao']);
 }
예제 #5
0
 public function getVoluntario()
 {
     return $this->hasOne(Voluntario::className(), ['idvoluntario' => 'voluntario_idvoluntario']);
 }