/** * Adds new user. * @param string * @param string * @param string * @param DateTime * @return void */ public function add($username, $password, $email, $date) { try { $data = array('username' => $username, 'password' => Passwords::hash($password), 'email' => $email, 'date' => $date, 'role' => 'user'); $this->usersFacade->update($data); } catch (Nette\Database\UniqueConstraintViolationException $e) { throw new DuplicateNameException(); } }
public function renderAddress() { $this->template->username = $this->usersFacade->find($this->id)->getUsername(); $this->template->id = $this->id; $this->template->addresses = $this->addressFacade->addressList($this->id); $this->template->head = $this->addressFacade->addressInfo($this->addressId); $this->template->tariff = $this->tariffs; $this->template->history = $this->calculationFacade->historyList($this->addressId); }
public function formAddSucceeded($form) { $this->addressFacade->update(array('country' => $form['country']->getValue(), 'city' => $form['city']->getValue(), 'street' => $form['street']->getValue(), 'house' => $form['house']->getValue(), 'room' => $form['room']->getValue(), 'user' => $this->usersFacade->find($this->user->id))); }