MinervaNeue
A responsive mobile first skin
Loading...
Searching...
No Matches
MediaWiki\Minerva\Menu\Group Class Reference

Model for a menu that can be presented in a skin. More...

Public Member Functions

 __construct ( $id)
 
 getId ()
 Get the identifier for the group.
 
 hasEntries ()
 Return entries count.
 
 getEntries ()
 Get all entries represented as plain old PHP arrays.
 
 prependEntry (IMenuEntry $entry)
 Prepend new menu entry.
 
 insertEntry (IMenuEntry $entry)
 Insert new menu entry.
 
 getEntryByName (string $targetName)
 
 serialize ()
 Serialize the group for use in a template.
 

Detailed Description

Model for a menu that can be presented in a skin.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Minerva\Menu\Group::__construct ( $id)
Parameters
string$idof the menu defaults to null (optional)

Member Function Documentation

◆ getEntries()

MediaWiki\Minerva\Menu\Group::getEntries ( )

Get all entries represented as plain old PHP arrays.

Returns
array

◆ getEntryByName()

MediaWiki\Minerva\Menu\Group::getEntryByName ( string $targetName)
Parameters
string$targetName
Returns
IMenuEntry
Exceptions
DomainException

◆ getId()

MediaWiki\Minerva\Menu\Group::getId ( )

Get the identifier for the group.

Returns
string

◆ hasEntries()

MediaWiki\Minerva\Menu\Group::hasEntries ( )

Return entries count.

Returns
bool

◆ insertEntry()

MediaWiki\Minerva\Menu\Group::insertEntry ( IMenuEntry $entry)

Insert new menu entry.

Parameters
IMenuEntry$entry
Exceptions
DomainExceptionWhen the entry already exists

◆ prependEntry()

MediaWiki\Minerva\Menu\Group::prependEntry ( IMenuEntry $entry)

Prepend new menu entry.

Parameters
IMenuEntry$entry
Exceptions
DomainExceptionWhen the entry already exists

◆ serialize()

MediaWiki\Minerva\Menu\Group::serialize ( )

Serialize the group for use in a template.

Returns
array{entries:array,id:string}

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