| 1 | <?php |
||
| 14 | abstract class AbstractItem implements ItemInterface |
||
| 15 | { |
||
| 16 | /** @var string */ |
||
| 17 | private $id; |
||
| 18 | |||
| 19 | /** @var string */ |
||
| 20 | private $path = null; |
||
| 21 | |||
| 22 | /** @var string */ |
||
| 23 | private $labelId; |
||
| 24 | |||
| 25 | /** @var string|null */ |
||
| 26 | private $permission; |
||
| 27 | |||
| 28 | /** @var AdminGroups */ |
||
| 29 | private $adminGroups; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * AbstractItem constructor. |
||
| 33 | * |
||
| 34 | * @param $id |
||
| 35 | * @param $path |
||
| 36 | * @param $labelId |
||
| 37 | * @param AdminGroups $adminGroups |
||
| 38 | * @param null $permission |
||
| 39 | */ |
||
| 40 | public function __construct($id, $path, $labelId, AdminGroups $adminGroups, $permission = null) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Unique identifier for menu item (needs to be unique in level) |
||
| 51 | * |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | public function getId() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | public function getPath() |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Label to be translated to be displayed on the menu. |
||
| 69 | * |
||
| 70 | * @return string |
||
| 71 | */ |
||
| 72 | public function getLabelId() |
||
| 76 | |||
| 77 | /** |
||
| 78 | * Get the permission required to use this menu item. |
||
| 79 | * |
||
| 80 | * @return mixed |
||
| 81 | */ |
||
| 82 | public function permission() |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @inheritdoc |
||
| 89 | */ |
||
| 90 | public function isVisibleFor($login) |
||
| 98 | } |
||
| 99 |