/**
  * Finds the PeriodoInscricaoMonitoria model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return PeriodoInscricaoMonitoria the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = PeriodoInscricaoMonitoria::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('A página requistada não existe.');
     }
 }
Beispiel #2
0
 public function afterFind()
 {
     switch ($this->bolsa) {
         case 0:
             $this->traducao_bolsa = 'Não';
             break;
         case 1:
             $this->traducao_bolsa = 'Sim';
             break;
     }
     switch ($this->status) {
         case 0:
             $this->traducao_status = 'Aguardando Avaliação';
             break;
         case 1:
             $this->traducao_status = 'Selecionado com bolsa';
             break;
         case 2:
             $this->traducao_status = 'Selecionado sem bolsa';
             break;
         case 3:
             $this->traducao_status = 'Não selecionado';
             break;
         case 4:
             $this->traducao_status = 'Indeferido - Nota < 7';
             break;
         case 5:
             $this->traducao_status = 'Indeferido - Coeficiente < 5';
             break;
         case 6:
             $this->traducao_status = 'Indeferido - Não cursou a disciplina';
             break;
     }
     $periodo = PeriodoInscricaoMonitoria::findOne(['id' => $this->IDperiodoinscr]);
     $this->IDperiodoinscr = $periodo->ano . '/' . $periodo->periodo;
     $disciplinaPeriodo = DisciplinaPeriodo::findOne($this->IDDisc);
     $disciplina = Disciplina::find()->where(['id' => $disciplinaPeriodo->idDisciplina])->one();
     $this->nomeDisciplina = $disciplina->nomeDisciplina;
     $curso = Curso::find()->where(['id' => $disciplinaPeriodo->idCurso])->one();
     $this->nomeCurso = $curso->nome;
 }