/** * Before any action do some setup * If we know the program and cycle load the applicant var * If we only know the program fill that in * @return null */ protected function beforeAction() { parent::beforeAction(); if (!empty($this->actionParams['programShortName'])) { $this->program = $this->_em->getRepository('Jazzee\\Entity\\Program')->findOneByShortName($this->actionParams['programShortName']); } if (!empty($this->actionParams['cycleName'])) { $this->cycle = $this->_em->getRepository('Jazzee\\Entity\\Cycle')->findOneByName($this->actionParams['cycleName']); } if (!is_null($this->program) and !is_null($this->cycle)) { $this->application = $this->_em->getRepository('Jazzee\\Entity\\Application')->findOneByProgramAndCycle($this->program, $this->cycle); } }