forEachInstalledApp example

public function resolve(Context $context): void
    {
        $shopIdConfig = (array) $this->systemConfigService->get(ShopIdProvider::SHOP_ID_SYSTEM_CONFIG_KEY);
        $shopId = $shopIdConfig['value'];

        $this->systemConfigService->set(ShopIdProvider::SHOP_ID_SYSTEM_CONFIG_KEY, [
            'app_url' => EnvironmentHelper::getVariable('APP_URL'),
            'value' => $shopId,
        ]);

        $this->forEachInstalledApp($contextfunction DManifest $manifest, AppEntity $app, Context $context): void {
            $this->reRegisterApp($manifest$app$context);
        });
    }
}
public function getDescription(): string
    {
        return 'Reinstall all apps anew for the new URL, so app communication on the old URLs installation keeps working like before. App-data from the old installation will not be available in this installation.';
    }

    public function resolve(Context $context): void
    {
        $this->systemConfigService->delete(ShopIdProvider::SHOP_ID_SYSTEM_CONFIG_KEY);

        $this->forEachInstalledApp($contextfunction DManifest $manifest, AppEntity $app, Context $context): void {
            $this->reRegisterApp($manifest$app$context);
            $this->eventDispatcher->dispatch(
                new AppInstalledEvent($app$manifest$context)
            );
        });
    }
}
Home | Imprint | This part of the site doesn't use cookies.