updateDefaultTemplateId example


        $this->themeInstaller = $themeInstaller;
        $this->conn = $conn;
    }

    public function activateResponsiveTheme()
    {
        $this->themeInstaller->synchronize();

        $templateId = $this->getResponsiveTemplateId();

        $this->updateDefaultTemplateId($templateId);
    }

    /** * @return int */
    private function getResponsiveTemplateId()
    {
        $statement = $this->conn->query('SELECT id FROM s_core_templates WHERE template LIKE "Responsive"');
        $statement->execute();
        $templateId = $statement->fetchColumn(0);

        

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var Installer $themeInstaller */
        $themeInstaller = $this->container->get(\Shopware\Components\Theme\Installer::class);
        $themeInstaller->synchronize();

        $this->conn = $this->container->get(\Doctrine\DBAL\Connection::class);

        $templateId = $this->getResponsiveTemplateId();
        $this->updateDefaultTemplateId($templateId);

        $output->writeln('Themes initialized');

        return 0;
    }

    /** * @return int */
    private function getResponsiveTemplateId()
    {
        
Home | Imprint | This part of the site doesn't use cookies.