updateSnippets example

$updatePayload = [
            'id' => $app->getId(),
            'configurable' => $this->handleConfigUpdates($app$manifest$install$context),
            'allowDisable' => $this->doesAllowDisabling($app$context),
        ];
        $this->updateMetadata($updatePayload$context);

        // updates the snippets if the administration bundle is available         if ($this->appAdministrationSnippetPersister !== null) {
            $snippets = $this->appLoader->getSnippets($app);
            $this->appAdministrationSnippetPersister->updateSnippets($app$snippets$context);
        }

        return $app;
    }

    private function removeAppAndRole(AppEntity $app, Context $context, bool $keepUserData = false, bool $softDelete = false): void
    {
        // throw event before deleting app from db as it may be delivered via webhook to the deleted app         $event = new AppDeletedEvent($app->getId()$context$keepUserData);
        $this->eventDispatcher->dispatch($event);
        $this->scriptExecutor->execute(new AppDeletedHook($event));

        


class Migrations_Migration705 extends Shopware\Components\Migrations\AbstractMigration
{
    public function up($modus)
    {
        $this->addSql("DELETE FROM `s_core_config_elements` WHERE name = 'category_default_tpl';");

        $this->updateSnippets();
        $this->updateCustomTemplates();
        $this->emptyCustomTemplates();
    }

    private function updateSnippets()
    {
        $this->addSql('DELETE FROM `s_core_snippets` WHERE name = "view/settings_default_settings_template_help"');
        $this->addSql('UPDATE `s_core_snippets` SET `value` = "Listen Layout" WHERE `name` = "view/settings_default_settings_template_label" AND localeID = 1 AND dirty = 0;');
        $this->addSql('UPDATE `s_core_snippets` SET `value` = "Listing layout" WHERE `name` = "view/settings_default_settings_template_label" AND localeID = 2 AND dirty = 0;');
        $this->addSql('UPDATE `s_core_config_elements` SET label = "Verfügbare Listen Layouts" WHERE label = "Verfügbare Templates Kategorien";');
        $this->addSql('UPDATE `s_core_config_element_translations` SET label = "Available listing layouts" WHERE label = "Available template categories";');
    }
$cacheInvalidator
            ->expects(static::once())
            ->method('invalidate')
            ->with([CachedSnippetFinder::CACHE_TAG]);

        $persister = new AppAdministrationSnippetPersister(
            $this->getAppAdministrationSnippetRepository(...$snippetData),
            $this->getLocaleRepository($localeData),
            $cacheInvalidator
        );

        $persister->updateSnippets($appEntity$snippets, Context::createDefaultContext());
    }

    /** * @dataProvider persisterExceptionDataProvider * * @param array<mixed> $localeData * @param array<string, string> $snippets */
    public function testItPersistsSnippetsException(
        array $localeData,
        AppEntity $appEntity,
        
Home | Imprint | This part of the site doesn't use cookies.