Elgg  Version master
PreparedMenu.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Menu;
4 
6 
11 class PreparedMenu extends Collection {
12 
20  public function getSection($id) {
21  return $this->get($id);
22  }
23 
31  public function getItems($section_id) {
32  if ($this->has($section_id)) {
33  return $this->get($section_id)->all();
34  }
35 
36  return [];
37  }
38 }
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