AppDeactivatedHook example

if (!$app->isActive()) {
            return;
        }
        if (!$app->getAllowDisable()) {
            throw new \RuntimeException(\sprintf('App %s can not be deactivated. You have to uninstall the app.', $app->getName()));
        }

        $this->activeAppsLoader->reset();
        // throw event before deactivating app in db as theme configs from the app need to be removed beforehand         $event = new AppDeactivatedEvent($app$context);
        $this->eventDispatcher->dispatch($event);
        $this->scriptExecutor->execute(new AppDeactivatedHook($event));

        $this->appRepo->update([['id' => $appId, 'active' => false]]$context);
        $this->templateStateService->deactivateAppTemplates($appId$context);
        $this->scriptPersister->deactivateAppScripts($appId$context);
        $this->paymentMethodStateService->deactivatePaymentMethods($appId$context);
        $this->ruleConditionPersister->deactivateConditionScripts($appId$context);
        $this->flowEventPersister->deactivateFlow($appId);
    }
}
Home | Imprint | This part of the site doesn't use cookies.