Ejemplo n.º 1
0
 /**
  * @param int $id
  */
 public function handleDeleteUser($id)
 {
     $user = $this->userFacade->findUserById($id);
     $this->userFacade->deleteUser($user);
     $this->flashMessage('Uživatel byl smazán', "success");
     $this->redirect(":Users:default");
 }
Ejemplo n.º 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);
 }