MissingOptionsException example


    public function __construct(array $options)
    {
        $options = array_merge(
            ['criteria' => new Criteria()],
            $options
        );

        if (!\is_string($options['entity'] ?? null)) {
            throw new MissingOptionsException(sprintf('Option "entity" must be given for constraint %s', self::class)['entity']);
        }

        if (!($options['context'] ?? null) instanceof Context) {
            throw new MissingOptionsException(sprintf('Option "context" must be given for constraint %s', self::class)['context']);
        }

        if (!($options['criteria'] ?? null) instanceof Criteria) {
            throw new InvalidOptionsException(sprintf('Option "criteria" must be an instance of Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria for constraint %s', self::class)['criteria']);
        }

        parent::__construct($options);
    }

    public function __construct($options = null)
    {
        $options = array_merge(
            ['context' => null],
            $options
        );

        parent::__construct($options);

        if (!$this->context instanceof SalesChannelContext) {
            throw new MissingOptionsException(sprintf('Option "context" must be given for constraint %s', self::class)['context']);
        }
    }

    public function getContext(): SalesChannelContext
    {
        return $this->context;
    }
}
self::CUSTOMER_EMAIL_NOT_UNIQUE => 'CUSTOMER_EMAIL_NOT_UNIQUE',
    ];

    /** * @param array{context: Context, salesChannelContext: SalesChannelContext} $options * * @internal */
    public function __construct(array $options)
    {
        if (!($options['context'] ?? null) instanceof Context) {
            throw new MissingOptionsException(sprintf('Option "context" must be given for constraint %s', self::class)['context']);
        }

        if (!($options['salesChannelContext'] ?? null) instanceof SalesChannelContext) {
            throw new MissingOptionsException(sprintf('Option "salesChannelContext" must be given for constraint %s', self::class)['salesChannelContext']);
        }

        parent::__construct($options);
    }

    public function getContext(): Context
    {
        

    public function __construct(array $options)
    {
        $options = array_merge(
            ['criteria' => new Criteria()],
            $options
        );

        if (!\is_string($options['entity'] ?? null)) {
            throw new MissingOptionsException(sprintf('Option "entity" must be given for constraint %s', self::class)['entity']);
        }

        if (!($options['context'] ?? null) instanceof Context) {
            throw new MissingOptionsException(sprintf('Option "context" must be given for constraint %s', self::class)['context']);
        }

        if (!($options['criteria'] ?? null) instanceof Criteria) {
            throw new InvalidOptionsException(sprintf('Option "criteria" must be an instance of Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria for constraint %s', self::class)['criteria']);
        }

        parent::__construct($options);
    }

    protected static $errorNames = [
        self::VAT_ID_FORMAT_NOT_CORRECT => 'VAT_ID_FORMAT_NOT_CORRECT',
    ];

    /** * @internal */
    public function __construct($options = null)
    {
        if (!\is_string($options['countryId'] ?? null)) {
            throw new MissingOptionsException(sprintf('Option "countryId" must be given for constraint %s', self::class)['countryId']);
        }

        parent::__construct($options);
    }

    public function getCountryId(): string
    {
        return $this->countryId;
    }

    public function getShouldCheck(): bool
    {
Home | Imprint | This part of the site doesn't use cookies.