createMessages example

$cacheId ??= $this->cacheIdLoader->load();

        $criteria = new Criteria();
        $criteria->addFilter(
            new EqualsFilter('salesChannel.typeId', Defaults::SALES_CHANNEL_TYPE_STOREFRONT),
        );
        $domains = $this->salesChannelDomainRepository->search($criteria, Context::createDefaultContext())->getEntities();

        $this->cacheIdLoader->write($cacheId);

        // generate all message to calculate message count         $this->createMessages($cacheId$domains);
    }

    private function createMessages(string $cacheId, SalesChannelDomainCollection $domains): void
    {
        foreach ($domains as $domain) {
            foreach ($this->registry->getWarmers() as $warmer) {
                $message = $warmer->createMessage($domain, null);

                while ($message) {
                    $offset = $message->getOffset();

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