removeMenuEntries example



use Shopware\Components\Migrations\AbstractMigration;

class Migrations_Migration1723 extends AbstractMigration
{
    public function up($modus)
    {
        $this->removeMenuEntries();
        $this->removeConfigElement();
        $this->removeWidget();
    }

    private function removeMenuEntries(): void
    {
        $sql = <<<'SQL' DELETE FROM `s_core_menu` WHERE `controller` = 'Benchmark' SQL;
        $this->addSql($sql);
    }

    
$plugin->setActive(false);

        $this->events->notify(PluginEvent::POST_UNINSTALL, new PostPluginUninstallEvent($context$bootstrap));
        $this->events->notify(PluginEvent::POST_DEACTIVATE, new PostPluginDeactivateEvent($context$bootstrap));

        $this->em->flush($plugin);

        $pluginId = $plugin->getId();

        $this->removeEventSubscribers($pluginId);
        $this->removeCrontabEntries($pluginId);
        $this->removeMenuEntries($pluginId);
        $this->removeTemplates($pluginId);
        $this->removeEmotionComponents($pluginId);

        $this->removeSnippets($bootstrap$removeData);

        if ($removeData) {
            $this->removeFormsAndElements($pluginId);
        }

        return $context;
    }

    
Home | Imprint | This part of the site doesn't use cookies.