Ejemplo n.º 1
0
 /**
  * Update draft status, touch and change duration.
  *
  * @param \_OurBrand_\Quiz\Domain\Model\Quiz $quiz
  * @param boolean $draft
  */
 public function updateQuiz($quiz, $draft)
 {
     $quiz->touch();
     $quiz->calculateDuration();
     $quiz->setIsDraft($draft);
     if ($this->request->hasArgument('category')) {
         $category = $this->persistenceManager->getObjectByIdentifier($this->request->getArgument('category'), '\\_OurBrand_\\Quiz\\Domain\\Model\\Category');
         $quiz->setCategory($category);
     }
     if ($draft == FALSE) {
         $this->quizService->makeSnapshotAndPersist($quiz);
     }
     $this->quizRepository->update($quiz);
 }