/** * @return string */ protected function getUsername() { $username = ''; if ($this->userFacade->hasCurrentUser()) { $user = $this->userFacade->getCurrentUser(); $username = sprintf('%s %s', $user->getFirstName(), $user->getLastName()); } return $username; }
/** * @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]]); }
/** * @param string $username * * @return bool */ public function hasActiveUserByUsername($username) { return $this->userFacade->hasActiveUserByUsername($username); }
/** * @return \Generated\Shared\Transfer\UserTransfer */ public function getCurrentUser() { return $this->userFacade->getCurrentUser(); }