0018375eedc1856bfe4045e9adfa02cacd076b0b
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / data / menu / item / MenuItemList.class.php
1 <?php
2
3 namespace wcf\data\menu\item;
4
5 use wcf\data\DatabaseObjectList;
6
7 /**
8 * Represents a list of menu items.
9 *
10 * @author Marcel Werk
11 * @copyright 2001-2019 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package WoltLabSuite\Core\Data\Menu\Item
14 * @since 3.0
15 *
16 * @method MenuItem current()
17 * @method MenuItem[] getObjects()
18 * @method MenuItem|null search($objectID)
19 * @property MenuItem[] $objects
20 */
21 class MenuItemList extends DatabaseObjectList
22 {
23 /**
24 * @inheritDoc
25 */
26 public $className = MenuItem::class;
27
28 /**
29 * Sets the menu items used to improve menu cache performance.
30 *
31 * @param MenuItem[] $menuItems list of menu item objects
32 */
33 public function setMenuItems(array $menuItems)
34 {
35 $this->objects = $menuItems;
36 $this->indexToObject = $this->objectIDs = \array_keys($this->objects);
37 }
38 }