Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
PluginPreUninstallEvent example
$uninstallContext
=
new
UninstallContext
(
$pluginBaseClass
,
$shopwareContext
,
$this
->shopwareVersion,
$plugin
->
getVersion
(
)
,
$this
->
createMigrationCollection
(
$pluginBaseClass
)
,
$keepUserData
)
;
$uninstallContext
->
setAutoMigrate
(
false
)
;
$this
->eventDispatcher->
dispatch
(
new
PluginPreUninstallEvent
(
$plugin
,
$uninstallContext
)
)
;
if
(
!
$shopwareContext
->
hasState
(
self::STATE_SKIP_ASSET_BUILDING
)
)
{
$this
->assetInstaller->
removeAssetsOfBundle
(
$pluginBaseClassString
)
;
}
$pluginBaseClass
->
uninstall
(
$uninstallContext
)
;
if
(
!
$uninstallContext
->
keepUserData
(
)
)
{
$pluginBaseClass
->
removeMigrations
(
)
;
$this
->systemConfigService->
deletePluginConfiguration
(
$pluginBaseClass
)
;
}