Example #1
0
 /**
  * @param $id
  * @param $performanceId
  * @param $childId
  */
 public function handleDeleteChild($id, $performanceId, $childId)
 {
     if ($id and $childId and $performanceId and $child = $this->childFacade->findChildById($childId)) {
         $this->childFacade->delete($child);
     }
     $this->flashMessage("Žák byl odebrán", "success");
     $this->redirect("this");
 }
Example #2
0
 /**
  * @param \Nette\Application\UI\Form $form
  */
 public function processForm(Form $form)
 {
     $values = $form->values;
     $teacher = $values->teacher ? $this->userFacade->findUserById($values->teacher) : null;
     if ($this->child) {
         $child = $this->child;
         $child->teacher = $teacher;
     } else {
         $child = new Entity\Child($this->performance, $teacher);
     }
     $child->name = $values->name;
     $child->instrument = $values->instrument;
     $child->class = $values->class;
     $this->childFacade->save($child);
 }