/**
* @param bool $removeData
*
* @throws Exception
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\ORM\OptimisticLockException
*
* @return UninstallContext
*/
public function uninstallPlugin(Plugin
$plugin,
$removeData = true
) { $context =
new UninstallContext($plugin,
$this->release->
getVersion(),
$plugin->
getVersion(), !
$removeData);
$bootstrap =
$this->
getPluginByName($plugin->
getName());
$this->events->
notify(PluginEvent::PRE_DEACTIVATE,
new PrePluginDeactivateEvent($context,
$bootstrap));
$this->events->
notify(PluginEvent::PRE_UNINSTALL,
new PrePluginUninstallEvent($context,
$bootstrap));
$this->
applyMigrations($bootstrap, AbstractPluginMigration::MODUS_UNINSTALL, !
$removeData);
$bootstrap->
uninstall($context);
$plugin->
setInstalled(null
);
$plugin->
setActive(false
);