public function verifyExistingEmail($value, ExecutionContextInterface $context)
    {
        $data = $context->getRoot()->getData();
        if ($data["account"] == 0) {
            $customer = CustomerQuery::create()->findOneByEmail($value);
            if ($customer) {
                $context->addViolation(Translator::getInstance()->trans("A user already exists with this email address. Please login or if you've forgotten your password, go to Reset Your Password."));
            }
        }
    }
public function verifyExistingEmail($value, ExecutionContextInterface $context)
    {
        $data = $context->getRoot()->getData();
        if ($data["account"] == 0) {
            $customer = CustomerQuery::create()->findOneByEmail($value);
            if ($customer) {
                $context->addViolation(Translator::getInstance()->trans("A user already exists with this email address. Please login or if you've forgotten your password, go to Reset Your Password."));
            }
        }
    }
public function verifyExistingEmail ( $ value , ExecutionContextInterface $ context ) { $ data = $ context -> getRoot ( ) -> getData ( ) ; if ( $ data [ "account" ] == 0 ) { $ customer = CustomerQuery :: create ( ) -> findOneByEmail ( $ value ) ; if ( $ customer ) { $ context -> addViolation ( Translator :: getInstance ( ) -> trans ( "A user already exists with this email address. Please login or if you've forgotten your password, go to Reset Your Password." ) ) ; } } }
If the user select "I'am a new customer", we make sure is email address does not exit in the database.
If the user select I am a new customer we make sure is email address does not exit in the database .