コード例 #1
0
ファイル: UserManager.php プロジェクト: 04EO/hup-nette
 /**
  * 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();
     }
 }
コード例 #2
0
ファイル: CabinetPresenter.php プロジェクト: 04EO/hup-nette
 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);
 }
コード例 #3
0
 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)));
 }