<?php

namespace kernel\modules\option;

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

class OptionModule extends Module
{

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

    /**
     * @throws \Exception
     */
    public function init(): void
    {
        $this->menuService->createItem([
           "label" => "Опции",
            "url" => "/admin/option",
            "slug" => "option"
        ]);
    }

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