getConfigFromBundle example



    /** * @return array<mixed>|null */
    private function fetchConfiguration(string $scope, ?string $configName, Context $context): ?array
    {
        $technicalName = \array_slice(explode('\\', $scope), -1)[0];

        foreach ($this->bundles as $bundle) {
            if ($bundle->getName() === $technicalName && $bundle instanceof Bundle) {
                return $this->configReader->getConfigFromBundle($bundle$configName);
            }
        }

        $app = $this->getAppByName($technicalName$context);
        if ($app) {
            return $this->appLoader->getConfiguration($app);
        }

        return null;
    }

    
public function delete(string $key, ?string $salesChannel = null): void
    {
        $this->setMultiple([$key => null]$salesChannel);
    }

    /** * Fetches default values from bundle configuration and saves it to database */
    public function savePluginConfiguration(Bundle $bundle, bool $override = false): void
    {
        try {
            $config = $this->configReader->getConfigFromBundle($bundle);
        } catch (BundleConfigNotFoundException) {
            return;
        }

        $prefix = $bundle->getName() . '.config.';

        $this->saveConfig($config$prefix$override);
    }

    /** * @param array<mixed> $config */
Home | Imprint | This part of the site doesn't use cookies.