CrossSellingRouteCacheTagsEvent example


    private function generateTags(string $productId, Request $request, ProductCrossSellingRouteResponse $response, SalesChannelContext $context, Criteria $criteria): array
    {
        $tags = array_merge(
            $this->tracer->get(self::buildName($productId)),
            $this->extractStreamTags($response),
            $this->extractProductIds($response),
            [self::buildName($productId)]
        );

        $event = new CrossSellingRouteCacheTagsEvent($productId$tags$request$response$context$criteria);
        $this->dispatcher->dispatch($event);

        return array_unique(array_filter($event->getTags()));
    }

    /** * @return array<string> */
    private function extractStreamTags(ProductCrossSellingRouteResponse $response): array
    {
        $ids = [];

        
Home | Imprint | This part of the site doesn't use cookies.