getBeforeConfirmValidation example

->first();

        if (!$customer instanceof CustomerEntity) {
            throw CustomerException::customerNotFoundByHash($dataBag->get('hash'));
        }

        $this->validator->validate(
            [
                'em' => $dataBag->get('em'),
                'doubleOptInRegistration' => $customer->getDoubleOptInRegistration(),
            ],
            $this->getBeforeConfirmValidation(hash('sha1', (string) $customer->getEmail()))
        );

        if ((!Feature::isActive('v6.6.0.0') && $customer->getActive())
            || $customer->getDoubleOptInConfirmDate() !== null) {
            throw CustomerException::customerAlreadyConfirmed($customer->getId());
        }

        $customerUpdate = [
            'id' => $customer->getId(),
            'doubleOptInConfirmDate' => new \DateTimeImmutable(),
        ];
        
Home | Imprint | This part of the site doesn't use cookies.