Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
UnpreparedMenu.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg\Menu;
3 
4 use ElggMenuItem;
5 
12 
16  private $items;
17 
21  private $params;
22 
33  public function __construct(array $params, array $items) {
34  $this->params = $params;
35  $this->items = $items;
36  }
37 
47  public function setSortBy($sort_by = 'text') {
48  $this->params['sort_by'] = $sort_by;
49  }
50 
59  public function getSortBy() {
60  return elgg_extract('sort_by', $this->params, 'text');
61  }
62 
68  public function getName() {
69  return $this->params['name'];
70  }
71 
77  public function getItems() {
78  return $this->items;
79  }
80 
86  public function getParams() {
87  return $this->params;
88  }
89 }
getSortBy()
Get the designated (or default) sort strategy.
__construct(array $params, array $items)
Constructor.
getParams()
Get the menu parameters.
setSortBy($sort_by= 'text')
Set how this menu should be sorted.
Linear set of menu items collected from configuration and the "register" hook.
getName()
Get the menu name.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1310
getItems()
Get the menu items.