Elgg  Version 5.1
PreparedMenu.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Menu;
4 
6 use ElggMenuItem;
7 
12 class PreparedMenu extends Collection {
13 
21  public function getSection($id) {
22  return $this->get($id);
23  }
24 
32  public function getItems($section_id) {
33  if ($this->has($section_id)) {
34  return $this->get($section_id)->all();
35  }
36 
37  return [];
38  }
39 }
A collection of unique items.
Definition: Collection.php:11
has($id)
{Check if collection has an item with a given ID.IDbool}
Definition: Collection.php:104
getItems($section_id)
Get items in a section.
getSection($id)
Get menu section.
Represents a menu that has been broken down into sections, with menu hierarchy trees setup...
all()
{Returns all collection items by reference.CollectionItemInterface[]}
Definition: Collection.php:71
$id
Generic annotation delete action.
Definition: delete.php:6