/** * Checks if an email-adress is unique * Null and empty will always return false. * * @param string $email * * @return bool */ public function isEmailUnique($email) { if ($email) { try { $this->userRepository->findUserByEmail($email); } catch (NoResultException $exc) { return true; } } return false; }