getOrderCreateValidationDefinition example


    }

    /** * @throws ConstraintViolationException */
    private function validateOrderData(
        ParameterBag $data,
        SalesChannelContext $context,
        bool $hasVirtualGoods
    ): void {
        $definition = $this->getOrderCreateValidationDefinition(new DataBag($data->all())$context$hasVirtualGoods);
        $violations = $this->dataValidator->getViolations($data->all()$definition);

        if ($violations->count() > 0) {
            throw new ConstraintViolationException($violations$data->all());
        }
    }

    private function getOrderCreateValidationDefinition(
        DataBag $data,
        SalesChannelContext $context,
        bool $hasVirtualGoods
    ):
Home | Imprint | This part of the site doesn't use cookies.