Files
kupshop/bundles/KupShop/KupShopBundle/Event/CreateMenuEvent.php
2025-08-02 16:30:27 +02:00

46 lines
865 B
PHP

<?php
namespace KupShop\KupShopBundle\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* For add menu items to AdminBar.
*/
class CreateMenuEvent extends Event
{
public const COMPLETING_TREE = 'kupshop.menu_completing_tree';
/**
* @var \AdminBarMenu
*/
protected $menu;
/**
* @var \UserRights
*/
protected $rights;
public function __construct($menu, $rights)
{
$this->menu = $menu;
$this->rights = $rights;
}
/**
* @param $menuName : Name of menu item for inserting
* @param $item : menuItem
*
* @return bool
*/
public function addItem($menuName, $item)
{
return $this->menu->addItem($menuName, $item);
}
public function addRights($list, $rights = [])
{
return $this->rights->addRights($list, $rights);
}
}