psr12 fixes for new PHP_CodeSniffer (#4795)
[openemr.git] / src / Menu / MenuEvent.php
blob1d9487ca93b6cb8f3d0e93b1ef7ec5d4feb8384d
1 <?php
3 /**
4 * MainMenuRole class.
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Stephen Nielson <stephen@nielson.org>
9 * @copyright Copyright (c) 2019 Stephen Nielson <stephen@nielson.org>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 namespace OpenEMR\Menu;
15 use Symfony\Component\EventDispatcher\Event;
17 class MenuEvent extends Event
19 /**
20 * The UPDATE event occurs once a menu has been created and had it's update
21 * menu map function called. This allows other listeners to apply additional updates
22 * to the menu.
24 * This event allows you to change the controller that will handle the
25 * request.
28 const MENU_UPDATE = 'menu.update';
30 /**
31 * The RESTRICT event occurs once a menu has been created, updated, and now is applying security ACLs or
32 * filters against the menu to decide if the menu should be shown or not.
34 const MENU_RESTRICT = 'menu.restrict';
38 /** @var array The menu list */
39 private $menu;
41 public function __construct($menu = [])
43 $this->menu = $menu;
46 /**
47 * Get a list of menu items
49 * @return array Array of menu items
51 public function getMenu()
53 return $this->menu;
56 public function setMenu(array $menu)
58 $this->menu = $menu;