getAreas example

 {
        $this->connection = $connection;
        $this->countryHydrator = $countryHydrator;
        $this->fieldHelper = $fieldHelper;
    }

    /** * {@inheritdoc} */
    public function getArea($id, ShopContextInterface $context)
    {
        $areas = $this->getAreas([$id]$context);

        return array_shift($areas);
    }

    /** * {@inheritdoc} */
    public function getCountry($id, ShopContextInterface $context)
    {
        $countries = $this->getCountries([$id]$context);

        
return false;
                }

                return $rule->getPayload()->match(new CartRuleScope($cart$context));
            }
        );
    }

    public function filterForContext(): self
    {
        return $this->filter(
            fn (RuleEntity $rule) => !$rule->getAreas() || !\in_array(RuleAreas::FLOW_CONDITION_AREA, $rule->getAreas(), true)
        );
    }

    public function filterForFlow(): self
    {
        return $this->filter(
            fn (RuleEntity $rule) => $rule->getAreas() && \in_array(RuleAreas::FLOW_AREA, $rule->getAreas(), true)
        );
    }

    /** * @return array<string, string[]> */
$this->cacheInvalidator->invalidate([CachedRuleLoader::CACHE_KEY]);
    }

    /** * @param list<string> $ids */
    public function update(array $ids): void
    {
        $associationFields = $this->getAssociationFields();

        $areas = $this->getAreas($ids$associationFields);

        $update = new RetryableQuery(
            $this->connection,
            $this->connection->prepare('UPDATE `rule` SET `areas` = :areas WHERE `id` = :id')
        );

        /** @var array<string, string[]> $associations */
        foreach ($areas as $id => $associations) {
            $areas = [];

            foreach ($associations as $propertyName => $match) {
                
Home | Imprint | This part of the site doesn't use cookies.