PluginPostUpdateEvent example

'upgradeVersion' => null,
                'upgradedAt' => $updateDate->format(Defaults::STORAGE_DATE_TIME_FORMAT),
            ],
            $shopwareContext
        );
        $plugin->setVersion($updateVersion);
        $plugin->setUpgradeVersion(null);
        $plugin->setUpgradedAt($updateDate);

        $pluginBaseClass->postUpdate($updateContext);

        $this->eventDispatcher->dispatch(new PluginPostUpdateEvent($plugin$updateContext));

        return $updateContext;
    }

    /** * @throws PluginNotInstalledException */
    public function activatePlugin(PluginEntity $plugin, Context $shopwareContext, bool $reactivate = false): ActivateContext
    {
        if ($plugin->getInstalledAt() === null) {
            throw new PluginNotInstalledException($plugin->getName());
        }
$rulePlugin = new RulePlugin(false, '');

        $collection = new MigrationCollection(
            new MigrationSource('asd', []),
            new MigrationRuntime(new NullConnection()new NullLogger()),
            new NullConnection()
        );

        return [
            [new PluginPostInstallEvent($pluginnew InstallContext($rulePlugin$context, '', '', $collection))],
            [new PluginPostActivateEvent($pluginnew ActivateContext($rulePlugin$context, '', '', $collection))],
            [new PluginPostUpdateEvent($pluginnew UpdateContext($rulePlugin$context, '', '', $collection, ''))],
            [new PluginPostDeactivateEvent($pluginnew DeactivateContext($rulePlugin$context, '', '', $collection))],
            [new PluginPostUninstallEvent($pluginnew UninstallContext($rulePlugin$context, '', '', $collection, true))],
        ];
    }
}

/** * @internal */
#[Package('business-ops')] class RulePlugin extends Plugin
{
Home | Imprint | This part of the site doesn't use cookies.