getFileSnippets example


    public function getList(int $page, int $limit, Context $context, array $requestFilters, array $sort): array
    {
        --$page;
        /** @var array<string, array{iso: string, id: string}> $metaData */
        $metaData = $this->getSetMetaData($context);

        $isoList = $this->createIsoList($metaData);
        $languageFiles = $this->getSnippetFilesByIso($isoList);

        $fileSnippets = $this->getFileSnippets($languageFiles$isoList);
        $dbSnippets = $this->databaseSnippetsToArray($this->findSnippetInDatabase(new Criteria()$context)$fileSnippets);

        $snippets = array_replace_recursive($fileSnippets$dbSnippets);
        $snippets = $this->fillBlankSnippets($snippets$isoList);

        foreach ($requestFilters as $requestFilterName => $requestFilterValue) {
            $snippets = $this->snippetFilterFactory->getFilter($requestFilterName)->filter($snippets$requestFilterValue);
        }

        $snippets = $this->sortSnippets($sort$snippets);

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