Elgg  Version 6.0
Public Member Functions | Protected Attributes | List of all members
Elgg\Menu\MenuSection Class Reference

Menu section. More...

Inheritance diagram for Elgg\Menu\MenuSection:
Elgg\Menu\MenuItems Elgg\Collections\CollectionItemInterface Elgg\Collections\Collection Elgg\Collections\CollectionInterface

Public Member Functions

 setId ($id)
 Set ID. More...
 
 getID ()
 Get unique item identifier within a collection. More...
 
 setPriority ($priority)
 Set section priority. More...
 
 getPriority ()
 Get priority (weight) of the item within a collection. More...
 
 getItem ($item_name)
 Get menu item by name. More...
 
 getItems ()
 Get menu items. More...
 
- Public Member Functions inherited from Elgg\Menu\MenuItems
 __construct ($items=[], $item_class=\ElggMenuItem::class)
 {} More...
 
- Public Member Functions inherited from Elgg\Collections\Collection
 __construct ($items=[], $item_class=null)
 Constructor. More...
 
 all ()
 {Returns all collection items by reference.
Returns
CollectionItemInterface[]
} More...
 
 count ()
 {Count collection items.
Returns
int
} More...
 
 add ($item)
 {Add a new item to collection.
Parameters
CollectionItemInterface$itemItem
Returns
static
} More...
 
 get ($id)
 {Get an item by its ID.
Parameters
string | int$idID
Returns
CollectionItemInterface|null
} More...
 
 has ($id)
 {Check if collection has an item with a given ID.
Parameters
string | int$idID
Returns
bool
} More...
 
 remove ($id)
 {Remove item from collection by its ID.
Parameters
string | int$idID
Returns
static
} More...
 
 fill ($items)
 {Replace collection items.
Parameters
CollectionItemInterface[]|Collection$items Items
Returns
static
} More...
 
 merge ($items)
 {Add new items to collection, replacing items with matching IDs.
Parameters
CollectionItemInterface[]|Collection$items Items
Returns
static
} More...
 
 filter (callable $callback=null)
 {Filter collection items using a custom filter Returns a new collection instance.
Parameters
callable$callbackFilter
Returns
static
} More...
 
 sort (callable $callback=null)
 {Sort fields using custom callable If not provided, will sort items by priority.
Parameters
callable$callbackSorter
Returns
static
} More...
 
 walk (callable $callback)
 Walk through members of the collection and apply a callback. More...
 
 map (callable $callback)
 {Walk through all items in the collection and apply a callback.
Parameters
callable$callbackMapper
Returns
mixed
} More...
 
 offsetExists ($offset)
 ArrayAccess interface functions. More...
 
 offsetGet ($offset)
 {} More...
 
 offsetSet ($offset, $value)
 {} More...
 
 offsetUnset ($offset)
 {} More...
 
 current ()
 SeekableIterator interface functions. More...
 
 next ()
 {} More...
 
 key ()
 {} More...
 
 valid ()
 {} More...
 
 rewind ()
 {} More...
 
 seek ($offset)
 {} More...
 

Protected Attributes

 $id
 
 $priority
 
- Protected Attributes inherited from Elgg\Collections\Collection
 $items = []
 
 $item_class
 
 $position
 

Additional Inherited Members

- Protected Member Functions inherited from Elgg\Collections\Collection
 assertValidItem ($item)
 Validate if item is a valid collection item. More...
 

Detailed Description

Menu section.

Definition at line 10 of file MenuSection.php.

Member Function Documentation

Elgg\Menu\MenuSection::getID ( )

Get unique item identifier within a collection.

Returns
string|int

Implements Elgg\Collections\CollectionItemInterface.

Definition at line 38 of file MenuSection.php.

Elgg\Menu\MenuSection::getItem (   $item_name)

Get menu item by name.

Parameters
string$item_nameMenu item name
Returns
|null

Definition at line 69 of file MenuSection.php.

Elgg\Menu\MenuSection::getItems ( )

Get menu items.

Returns
[]

Definition at line 78 of file MenuSection.php.

Elgg\Menu\MenuSection::getPriority ( )

Get priority (weight) of the item within a collection.

Returns
int

Implements Elgg\Collections\CollectionItemInterface.

Definition at line 58 of file MenuSection.php.

Elgg\Menu\MenuSection::setId (   $id)

Set ID.

Parameters
string$idID
Returns
void

Definition at line 29 of file MenuSection.php.

Elgg\Menu\MenuSection::setPriority (   $priority)

Set section priority.

Parameters
int$priorityPriority
Returns
void

Definition at line 49 of file MenuSection.php.

Member Data Documentation

Elgg\Menu\MenuSection::$id
protected

Definition at line 15 of file MenuSection.php.

Elgg\Menu\MenuSection::$priority
protected

Definition at line 20 of file MenuSection.php.


The documentation for this class was generated from the following file: