\Charcoal\Admin\Ui\SidemenuGenericSidemenuGroup

Generic, concrete, implementation of {@see \Charcoal\Admin\Ui\Sidemenu\SidemenuGroupInterface}.

Summary

Methods
Properties
Constants
__construct()
setSidemenu()
sidemenu()
setGroupId()
groupId()
setDisplayType()
displayType()
setLinks()
addLink()
links()
hasLinks()
numLinks()
isSelected()
displayAsPanel()
collapsible()
setCollapsed()
collapsed()
setParented()
parented()
setIdent()
ident()
setActive()
active()
setPriority()
priority()
No public properties found
No constants found
No protected methods found
$sidemenu
$groupId
$displayType
$isSelected
$links
N/A
No private methods found
$collapsible
$collapsed
$parented
$ident
$active
$priority
N/A

Properties

$groupId

$groupId : string

The sidemenu group ID.

Type

string

$displayType

$displayType : string

The group's display type.

Type

string

$isSelected

$isSelected : boolean

Whether the item is selected or not.

Type

boolean

$links

$links : array

The group's links.

Type

array

$collapsible

$collapsible : boolean

Whether the group is collapsible or not.

Type

boolean

$collapsed

$collapsed : boolean

Whether the group is collapsed or not.

Type

boolean

$parented

$parented : boolean

Whether the group has siblings or not.

Type

boolean

$ident

$ident : string

The group's identifier.

Type

string

$active

$active : boolean

Whether the group is active.

Type

boolean

$priority

$priority : integer

The group's priority.

Type

integer

Methods

__construct()

__construct(array|\Charcoal\Admin\Ui\Sidemenu\ArrayAccess  $data) 

Returns a new sidemenu group.

Parameters

array|\Charcoal\Admin\Ui\Sidemenu\ArrayAccess $data

The class depdendencies.

setGroupId()

setGroupId(string  $id) : self

Set the group ID.

Parameters

string $id

The group ID.

Throws

\InvalidArgumentException

If the group ID argument is not a string.

Returns

self

groupId()

groupId() : string

Retrieve the group ID.

Returns

string

setDisplayType()

setDisplayType(mixed  $type) : self

Set the display type of the group.

Parameters

mixed $type

The display type.

Throws

\InvalidArgumentException

If the display type is invalid.

Returns

self

displayType()

displayType() : string|null

Retrieve the display type of the group.

Returns

string|null

setLinks()

setLinks(array  $links) : self

Set the sidemenu links.

Parameters

array $links

A collection of link objects.

Returns

self

addLink()

addLink(string  $linkIdent, array|object  $link) : self

Set the sidemenu links.

Parameters

string $linkIdent

The link identifier.

array|object $link

The link object or structure.

Throws

\InvalidArgumentException

If the link is invalid.

Returns

self

links()

links() : \ArrayIterator|\Charcoal\Admin\Ui\Sidemenu\Generator

Retrieve the sidemenu links.

Returns

\ArrayIterator|\Charcoal\Admin\Ui\Sidemenu\Generator

hasLinks()

hasLinks() : boolean

Determine if the sidemenu has any links.

Returns

boolean

numLinks()

numLinks() : integer

Count the number of sidemenu links.

Returns

integer

isSelected()

isSelected(boolean|null  $flag = null) : boolean

Set whether the item is selected or not.

Parameters

boolean|null $flag

Whether the item is selected or not.

Returns

boolean

displayAsPanel()

displayAsPanel() : boolean

Determine if the sidemenu groups should be displayed as panels.

Returns

boolean

collapsible()

collapsible() : boolean

Determine if the group is collapsible.

Returns

boolean

setCollapsed()

setCollapsed(boolean  $flag) : self

Set whether the group is collapsed or not.

Parameters

boolean $flag

Whether the group is collapsed or not.

Returns

self

collapsed()

collapsed() : boolean

Determine if the group is collapsed.

Returns

boolean

setParented()

setParented(boolean  $flag) : self

Set whether the group is related to other groups.

Parameters

boolean $flag

Whether the group has siblings or not.

Returns

self

parented()

parented() : boolean

Determine if the group is related to other groups.

Returns

boolean

setIdent()

setIdent(string  $ident) : self

Set the identifier of the group.

Parameters

string $ident

The group identifier.

Returns

self

ident()

ident() : string

Retrieve the idenfitier of the group.

Returns

string

setActive()

setActive(boolean  $active) : self

Set whether the group is active or not.

Parameters

boolean $active

The active flag.

Returns

self

active()

active() : boolean

Determine if the group is active or not.

Returns

boolean

setPriority()

setPriority(integer  $priority) : self

Set the group's priority or sorting index.

Parameters

integer $priority

An index, for sorting.

Throws

\InvalidArgumentException

If the priority is not an integer.

Returns

self

priority()

priority() : integer

Retrieve the group's priority or sorting index.

Returns

integer