‪TYPO3CMS  ‪main
ModifyAllowedItemsEvent.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
24 {
29  public function ‪__construct(
30  protected array $allowedItems,
31  protected array $currentLinkParts,
32  ) {}
33 
37  public function ‪getAllowedItems(): array
38  {
39  return $this->allowedItems;
40  }
41 
42  public function ‪addAllowedItem(string $item): self
43  {
44  $this->allowedItems[] = $item;
45  return $this;
46  }
47 
48  public function ‪removeAllowedItem(string $new): self
49  {
50  $this->allowedItems = array_filter($this->allowedItems, static fn(string $item): bool => $item !== $new);
51  return $this;
52  }
53 
57  public function getCurrentLinkParts(): array
58  {
59  return $this->currentLinkParts;
60  }
61 }
‪TYPO3\CMS\Backend\Controller\Event\ModifyAllowedItemsEvent\__construct
‪__construct(protected array $allowedItems, protected array $currentLinkParts,)
Definition: ModifyAllowedItemsEvent.php:29
‪TYPO3\CMS\Backend\Controller\Event
Definition: AfterBackendPageRenderEvent.php:18
‪TYPO3\CMS\Backend\Controller\Event\ModifyAllowedItemsEvent\addAllowedItem
‪addAllowedItem(string $item)
Definition: ModifyAllowedItemsEvent.php:42
‪TYPO3\CMS\Backend\Controller\Event\ModifyAllowedItemsEvent\removeAllowedItem
‪removeAllowedItem(string $new)
Definition: ModifyAllowedItemsEvent.php:48
‪TYPO3\CMS\Backend\Controller\Event\ModifyAllowedItemsEvent\getAllowedItems
‪string[] getAllowedItems()
Definition: ModifyAllowedItemsEvent.php:37
‪TYPO3\CMS\Backend\Controller\Event\ModifyAllowedItemsEvent
Definition: ModifyAllowedItemsEvent.php:24