mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Added draft for user menu based on https://gist.github.com/lsv/4d8044d21819f28f0dde52a3fb8211a0
This commit is contained in:
59
application/src/Event/Menu/Topbar/UserMenuEvent.php
Normal file
59
application/src/Event/Menu/Topbar/UserMenuEvent.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Event\Menu\Topbar;
|
||||
|
||||
use Knp\Menu\FactoryInterface;
|
||||
use Knp\Menu\ItemInterface;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
|
||||
class UserMenuEvent extends Event
|
||||
{
|
||||
public const EVENT = 'app.menu.topbar.user';
|
||||
|
||||
/**
|
||||
* @var FactoryInterface
|
||||
*/
|
||||
private $factory;
|
||||
|
||||
/**
|
||||
* @var ItemInterface
|
||||
*/
|
||||
private $item;
|
||||
|
||||
/**
|
||||
* @var RequestStack
|
||||
*/
|
||||
private $request;
|
||||
|
||||
public function __construct(FactoryInterface $factory, ItemInterface $item, RequestStack $request)
|
||||
{
|
||||
$this->factory = $factory;
|
||||
$this->item = $item;
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return FactoryInterface
|
||||
*/
|
||||
public function getFactory(): FactoryInterface
|
||||
{
|
||||
return $this->factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ItemInterface
|
||||
*/
|
||||
public function getItem(): ItemInterface
|
||||
{
|
||||
return $this->item;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RequestStack
|
||||
*/
|
||||
public function getRequest(): RequestStack
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user