コード例 #1
0
ファイル: PacoteController.php プロジェクト: schw/SGE3
 /**
  * Finds the Pacote model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Pacote the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Pacote::findOne($id)) !== null) {
         $model->setItemProgramacaoPacote();
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #2
0
ファイル: Inscritos.php プロジェクト: schw/SGE3
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPacoteIdpacote()
 {
     return $this->hasOne(Pacote::className(), ['idpacote' => 'pacote_idpacote']);
 }
コード例 #3
0
ファイル: ItemProgramacao.php プロジェクト: schw/SGE3
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPacoteIdpacotes()
 {
     return $this->hasMany(Pacote::className(), ['idpacote' => 'pacote_idpacote'])->viaTable('itemprogramacao_has_pacote', ['itemProgramacao_iditemProgramacao' => 'iditemProgramacao']);
 }
コード例 #4
0
ファイル: Evento.php プロジェクト: schw/SGE3
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPacotes()
 {
     return $this->hasMany(Pacote::className(), ['evento_idevento' => 'idevento']);
 }
コード例 #5
0
ファイル: Pacote.php プロジェクト: schw/SGE3
 public function getPacote($id_usuario, $id_evento)
 {
     $id_evento = Yii::$app->request->post('evento_idevento');
     return $results = Pacote::find()->where(['evento_idevento' => $id_evento, 'usuario_idusuario' => $id_usuario]);
 }
コード例 #6
0
ファイル: Inscreve.php プロジェクト: schw/SGE3
 public function possuiPacote()
 {
     $id_evento = Yii::$app->request->post('evento_idevento');
     if ($id_evento == NULL) {
         $id_evento = Yii::$app->request->get('id');
     }
     $results = Pacote::find()->where(['evento_idevento' => $id_evento])->count();
     return $results;
 }