getRegionFilterItems example

$connection->insert('snippet', [
            'id' => Uuid::randomBytes(),
            'translation_key' => 'test.ab',
            'value' => 'foo_ab',
            'author' => 'shopware',
            'snippet_set_id' => $fooId,
            'created_at' => (new \DateTimeImmutable())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
        ]);

        $service = $this->getSnippetService($snippetFile);
        $result = $service->getRegionFilterItems(Context::createDefaultContext());

        static::assertEquals([
            'bar',
            'foo',
            'test',
        ]$result);
    }

    public function testGetAuthors(): void
    {
        $snippetFile = new MockSnippetFile('foo', '{}');
        
$limit,
                $context,
                $request->request->all('filters'),
                $request->request->all('sort')
            )
        );
    }

    #[Route(path: '/api/_action/snippet/filter', name: 'api.action.snippet.get.filter', methods: ['GET'])]     public function getFilterItems(Context $context): Response
    {
        $filter = $this->snippetService->getRegionFilterItems($context);

        return new JsonResponse([
            'total' => \count($filter),
            'data' => $filter,
        ]);
    }

    #[Route(path: '/api/_action/snippet-set/baseFile', name: 'api.action.snippet-set.base-file', methods: ['GET'])]     public function getBaseFiles(): Response
    {
        $files = $this->snippetFileCollection->getFilesArray();

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