deleteExtensionConfiguration example


        // 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));

        $context->scope(Context::SYSTEM_SCOPE, function DContext $context) use ($app$softDelete$keepUserData): void {
            if (!$keepUserData) {
                $config = $this->appLoader->getConfiguration($app);

                if ($config) {
                    $this->systemConfigService->deleteExtensionConfiguration($app->getName()$config);
                }
            }

            $this->appRepository->delete([['id' => $app->getId()]]$context);

            if ($softDelete) {
                $this->integrationRepository->update([[
                    'id' => $app->getIntegrationId(),
                    'deletedAt' => new \DateTimeImmutable(),
                ]]$context);
                $this->permissionPersister->softDeleteRole($app->getAclRoleId());
            }

    }

    public function deletePluginConfiguration(Bundle $bundle): void
    {
        try {
            $config = $this->configReader->getConfigFromBundle($bundle);
        } catch (BundleConfigNotFoundException) {
            return;
        }

        $this->deleteExtensionConfiguration($bundle->getName()$config);
    }

    /** * @param array<mixed> $config */
    public function deleteExtensionConfiguration(string $extensionName, array $config): void
    {
        $prefix = $extensionName . '.config.';

        $configKeys = [];
        foreach ($config as $card) {
            
Home | Imprint | This part of the site doesn't use cookies.