getShopIds example

return $condition instanceof NotOrderedInShopCondition;
    }

    public function handle(ConditionInterface $condition, QueryBuilder $query): void
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(NotOrderedInShopCondition $condition, QueryBuilder $query): void
    {
        $likes = [];
        foreach ($condition->getShopIds() as $i => $number) {
            $likes[] = 'ordered_in_shops LIKE :shop' . $i;
        }

        $query->where('customernumber NOT IN ( SELECT customernumber FROM s_customer_search_index WHERE ' . implode(' OR ', $likes) . ' )'
        );
        foreach ($condition->getShopIds() as $i => $id) {
            


    public function handle(ConditionInterface $condition, QueryBuilder $query): void
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(NotRegisteredInShopCondition $condition, QueryBuilder $query): void
    {
        $query->andWhere('customer.shop_id NOT IN (:NotRegisteredInShopCondition)');

        $query->setParameter(':NotRegisteredInShopCondition', $condition->getShopIds(), Connection::PARAM_INT_ARRAY);
    }
}
'tpl3variable' => $site->getTpl3Variable(),
            'tpl3path' => $site->getTpl3Path(),
            'description' => $site->getDescription(),
            'pageTitle' => $site->getPageTitle(),
            'metaKeywords' => $site->getMetaKeywords(),
            'metaDescription' => $site->getMetaDescription(),
            'html' => $site->getHtml(),
            'grouping' => $site->getGrouping(),
            'position' => $site->getPosition(),
            'link' => $site->getLink(),
            'target' => $site->getTarget(),
            'shopIds' => $site->getShopIds(),
            'changed' => $site->getChanged(),
            'parentId' => $site->getParentId(),
            'leaf' => true,
        ];

        // If the site has children, append them         if ($site->getChildren()->count() > 0) {
            $children = [];
            foreach ($site->getChildren() as $child) {
                $children[] = $this->getSiteNode($idPrefix . $site->getId() . '_', $child);
            }
            
return $shopPages;
    }

    /** * @param array<int, ShopPage> $shopPages */
    private function resolveShops(array $shopPages): void
    {
        $shopIds = [];
        foreach ($shopPages as $page) {
            $shopIds += (array) $page->getShopIds();
        }

        $shops = $this->shopGateway->getList(array_keys(array_flip($shopIds)));

        foreach ($shopPages as $page) {
            $pageShops = array_filter($shopsfunction DShop $shop) use ($page) {
                return \array_key_exists($shop->getId()$page->getShopIds());
            });

            $page->setShops($pageShops);
        }
    }
// First match is the whole org_path         $formId = (int) array_pop($matches);

        $formRepository = $this->modelManager->getRepository(Form::class);
        $form = $formRepository->find($formId);

        if (!$form) {
            return false;
        }

        // Finally, check if the current form is specific for this subshop or not         return !empty($form->getShopIds());
    }

    /** * @return bool */
    private function checkSpecificShopSite(array $matches)
    {
        // First match is the whole org_path         $siteId = (int) array_pop($matches);

        $siteRepository = $this->modelManager->getRepository(Site::class);
        
ShopGatewayInterface $shopGateway
    ) {
        $this->connection = $connection;
        $this->shopGateway = $shopGateway;
    }

    /** * @return Shop[] */
    public function getShops()
    {
        return $this->shopGateway->getList($this->getShopIds());
    }

    /** * @return int[] */
    public function getShopIds()
    {
        return $this->connection->createQueryBuilder()
            ->select('id')
            ->from('s_core_shops', 'shop')
            ->execute()
            


    public function handle(ConditionInterface $condition, QueryBuilder $query)
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(RegisteredInShopCondition $condition, QueryBuilder $query): void
    {
        $query->andWhere('customer.shop_id IN (:RegisteredInShopCondition)');

        $query->setParameter(':RegisteredInShopCondition', $condition->getShopIds(), Connection::PARAM_INT_ARRAY);
    }
}
array_intersect_key($categoriesarray_flip($emotion->getCategoryIds()))
            );
        }
    }

    /** * @param Emotion[] $emotions */
    private function resolveShops(array $emotions)
    {
        $shopIds = array_map(function DEmotion $emotion) {
            return $emotion->getShopIds();
        }$emotions);

        $shopIds = array_keys(array_flip(array_merge(...$shopIds)));
        $shopIds = array_filter($shopIds);

        if (empty($shopIds)) {
            return;
        }

        $shops = $this->shopGateway->getList($shopIds);

        
return $condition instanceof OrderedInShopCondition;
    }

    public function handle(ConditionInterface $condition, QueryBuilder $query)
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(OrderedInShopCondition $condition, QueryBuilder $query): void
    {
        $wheres = [];
        foreach ($condition->getShopIds() as $i => $id) {
            $wheres[] = 'customer.ordered_in_shops LIKE :shop' . $i;
            $query->setParameter(':shop' . $i, '%|' . $id . '|%');
        }
        $query->andWhere(implode(' OR ', $wheres));
    }
}
Home | Imprint | This part of the site doesn't use cookies.