Enlight_Config_Adapter_DbTable example

$snippetRepository = $this->em->getRepository('Shopware\Models\Snippet\Snippet');

        $locale = $this->em->getRepository('Shopware\Models\Shop\Locale')->findOneByLocale($localeName);
        if (!$locale) {
            throw new Exception(sprintf('Locale "%s" not found.', $localeName));
        }

        $outputAdapter = new Enlight_Config_Adapter_File([
            'configDir' => $snippetsDir . '/',
        ]);
        $inputAdapter = new Enlight_Config_Adapter_DbTable([
            'db' => $this->db,
            'table' => 's_core_snippets',
            'namespaceColumn' => 'namespace',
            'sectionColumn' => ['localeID', 'shopID'],
        ]);

        $namespaces = array_map(
            function D$result) {
                return $result['namespace'];
            },
            $snippetRepository->getDistinctNamespacesQuery($locale->getId())->getArrayResult()
        );
Home | Imprint | This part of the site doesn't use cookies.