setSystemConfig example


    /** * @internal */
    public function __construct(private readonly Connection $connection)
    {
    }

    public function updateBasicInformation(?string $shopName, ?string $email): void
    {
        if ($shopName) {
            $this->setSystemConfig('core.basicInformation.shopName', $shopName);
        }

        if ($email) {
            $this->setSystemConfig('core.basicInformation.email', $email);
        }
    }

    public function setDefaultLanguage(string $locale): void
    {
        $locale = str_replace('_', '-', $locale);

        
class Migration1650620993SetDefaultCmsPagesAndSetCategoryCmsPageToNull extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1650620993;
    }

    public function update(Connection $connection): void
    {
        // set system config key for categories         $cmsPageId = $this->getDefaultCmsPageIdFromType('product_list', $connection);
        $this->setSystemConfig(CategoryDefinition::CONFIG_KEY_DEFAULT_CMS_PAGE_CATEGORY, $cmsPageId$connection);

        // set system config key for products         $this->setSystemConfig(ProductDefinition::CONFIG_KEY_DEFAULT_CMS_PAGE_PRODUCT, Defaults::CMS_PRODUCT_DETAIL_PAGE, $connection);

        $connection->executeStatement('UPDATE category SET cms_page_id = null WHERE cms_page_id = :defaultCmsPageId;', ['defaultCmsPageId' => Uuid::fromHexToBytes($cmsPageId)]);
    }

    public function updateDestructive(Connection $connection): void
    {
    }

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