Exemplo n.º 1
0
 /**
  * @param \_OurBrand_\Quiz\Domain\Model\Quiz $quiz
  * @Flow\IgnoreValidation("$quiz")
  * @throws \Exception
  */
 public function destroyAction($quiz)
 {
     // Several things we need to check for. If the quiz has been assigned to
     // student we may have a problem. (we do)
     $sessions = $this->studentQuizSessionRepository->findByQuiz($quiz);
     if ($sessions->count() > 0) {
         throw new \Exception('Can not delete quiz that has been assigned');
     }
     $this->quizRepository->remove($quiz);
     $this->redirect('index');
 }