/** * @param \Nette\Application\UI\Form $form */ public function processForm(Form $form) { $nextPosition = $this->performanceFacade->getNextPositionByEvent($this->event); $values = $form->values; $performance = $this->performance ? $this->performance : new Entity\Performance($this->event); $performance->songAuthor = $values->songAuthor; $performance->songName = $values->songName; $performance->note = $values->note; $performance->setPosition($nextPosition); $this->performanceFacade->save($performance); }
/** * @param $id * @param $performanceId * @param $position * * @throws \Exception */ public function handleMovePerformance($id, $performanceId, $position) { if ($performanceId and $performance = $this->performanceFacade->findPerformanceById($performanceId)) { $performance->setPosition($position); } $this->entityManager->flush(); $this->flashMessage("Představení bylo posunuto", "success"); $this->redirect(":Event:detail", $id); }