isExistingEmail example

$customerId = $constraint->getCustomerId();

        if (empty($email)) {
            $this->addError($this->getSnippet(self::SNIPPET_MAIL_FAILURE));
        }

        if (!$this->emailValidator->isValid($email)) {
            $this->addError($this->getSnippet(self::SNIPPET_MAIL_FAILURE));
        }

        if (!$this->isFastLogin($constraint) && $this->isExistingEmail($email$shop$customerId)) {
            $this->addError($this->getSnippet(self::SNIPPET_MAIL_DUPLICATE));
        }
    }

    /** * @param string $message */
    private function addError($message)
    {
        $this->context
            ->buildViolation($message)
            
$userId = $constraint->getUserId();

        if (empty($email)) {
            $this->addError($this->getSnippet(NoUrlValidator::SNIPPET_EMPTY_FIELD));
        }

        if (!$this->emailValidator->isValid($email)) {
            $this->addError($this->getSnippet(self::SNIPPET_MAIL_FAILURE));
        }

        if ($this->isExistingEmail($email$userId)) {
            $this->addError($this->getSnippet(self::SNIPPET_MAIL_DUPLICATE));
        }
    }

    /** * @param string $message */
    private function addError($message)
    {
        $this->context
            ->buildViolation($message)
            
Home | Imprint | This part of the site doesn't use cookies.