<?php

namespace kernel\modules\menu;

use kernel\Module;
use kernel\modules\menu\service\MenuService;

class MenuModule extends Module
{

    public MenuService $menuService;
    public function __construct()
    {
        $this->menuService = new MenuService();
    }

    /**
     * @throws \Exception
     */
    public function init(): void
    {
        $this->menuService->createItem([
            "label" => "Меню",
            "url" => "/admin/settings/menu",
            "slug" => "menu",
            "parent_slug" => "settings"
        ]);
    }

    public function deactivate(): void
    {
        $this->menuService->removeItemBySlug("menu");
    }
}