getStreams example

$productId = Uuid::randomHex();
        $this->createProduct($productId);

        $message = new ProductStreamMappingIndexingMessage($streamId, null, Context::createDefaultContext());
        $this->productStreamUpdater->handle($message);

        $criteria = new Criteria([$productId]);
        $criteria->addAssociation('streams');
        $product = $this->productRepository->search($criteria, Context::createDefaultContext())->first();

        static::assertEquals(1, $product->getStreams()->count());
        static::assertEquals($streamId$product->getStreams()->first()->getId());
        static::assertContains($streamId$product->getStreamIds());
    }

    /** * @return iterable<string, array<int, array<int, array<string, array<string, int>|string>>>> */
    public static function filterProvider(): iterable
    {
        yield 'Active filter' => [
            [[
                


    /** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $streamIds = [];
        if ($streamId = $input->getOption('streamId')) {
            $streamIds = [$streamId];
        }
        $streams = $this->getStreams($streamIds);

        foreach ($streams as $stream) {
            $output->writeln("\n## Indexing Customer Stream: " . $stream->getName() . ' ##');
            $this->container->get(\Shopware\Components\Api\Resource\CustomerStream::class)->indexStream($stream);
        }

        return 0;
    }

    /** * @param array<int> $ids * * @return CustomerStream[] */
Home | Imprint | This part of the site doesn't use cookies.