Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setUpdateVersion example
$this
->events->
notify
(
PluginEvent::PRE_UPDATE,
new
PrePluginUpdateEvent
(
$context
,
$pluginBootstrap
)
)
;
$this
->
installResources
(
$pluginBootstrap
,
$plugin
)
;
$this
->
applyMigrations
(
$pluginBootstrap
, AbstractPluginMigration::MODUS_UPDATE
)
;
$pluginBootstrap
->
update
(
$context
)
;
$this
->events->
notify
(
PluginEvent::POST_UPDATE,
new
PostPluginUpdateEvent
(
$context
,
$pluginBootstrap
)
)
;
$plugin
->
setVersion
(
$context
->
getUpdateVersion
(
)
)
;
$plugin
->
setUpdateVersion
(
null
)
;
$plugin
->
setUpdateSource
(
null
)
;
$plugin
->
setUpdated
(
new
DateTime
(
)
)
;
$this
->em->
flush
(
$plugin
)
;
return
$context
;
}
/** * @throws Exception * @throws \Doctrine\ORM\OptimisticLockException * * @return ActivateContext */