Esempio n. 1
0
 /**
  * @return string
  */
 protected function getUsername()
 {
     $username = '';
     if ($this->userFacade->hasCurrentUser()) {
         $user = $this->userFacade->getCurrentUser();
         $username = sprintf('%s %s', $user->getFirstName(), $user->getLastName());
     }
     return $username;
 }
Esempio n. 2
0
 /**
  * @return \Symfony\Component\Validator\Constraint
  */
 protected function createUniqueEmailConstraint()
 {
     return new Callback(['methods' => [function ($email, ExecutionContextInterface $contextInterface) {
         if ($this->userFacade->hasUserByUsername($email)) {
             $contextInterface->addViolation('User with email "{{ username }}" already exists.', ['{{ username }}' => $email]);
         }
     }], 'groups' => [self::GROUP_UNIQUE_USERNAME_CHECK]]);
 }
Esempio n. 3
0
 /**
  * @param string $username
  *
  * @return bool
  */
 public function hasActiveUserByUsername($username)
 {
     return $this->userFacade->hasActiveUserByUsername($username);
 }
Esempio n. 4
0
 /**
  * @return \Generated\Shared\Transfer\UserTransfer
  */
 public function getCurrentUser()
 {
     return $this->userFacade->getCurrentUser();
 }