PHP Class Sulu\Bundle\AdminBundle\Navigation\NavigationItem

Contains the name and the coupled action for this specific NavigationItem.
Inheritance: implements Iterator
Show file Open project: sulu/sulu Class Usage Examples

Protected Properties

Property Type Description
$action string The action which should be executed when clicking on this NavigationItem.
$children array Contains the children of this item, which are other NavigationItems.
$disabled boolean Defines if item is disabled.
$displayOption string Describes how the navigation item should be shown in husky.
$hasSettings boolean Defines if this menu item has settings.
$headerIcon string The icon of the header are of the NavigationItem.
$headerTitle string The title of the head area of the NavigationItem.
$icon string The icon of the navigationItem.
$id string The id of the NavigationItem.
$name string The name being displayed in the navigation.
$position integer The current position of the iterator.

Public Methods

Method Description
__construct ( string $name, NavigationItem $parent = null )
addChild ( NavigationItem $child ) Adds a child to the navigation item.
copyChildless ( ) : NavigationItem Returns a copy of this navigation item without its children.
current ( ) : mixed Return the current element.
equalsChildless ( NavigationItem $other ) : boolean Compares this item with another one, but doesn't check the children.
find ( NavigationItem $navigationItem ) : NavigationItem Searches for the equivalent of a specific NavigationItem.
findChildren ( NavigationItem $navigationItem ) : NavigationItem | null Searches for a specific NavigationItem in the children of this NavigationItem.
getAction ( ) : string Returns the action of the NavigationItem.
getChildren ( ) : array Returns all children from this navigation item.
getDisabled ( ) : boolean
getEvent ( ) : string
getEventArguments ( ) : string
getHasSettings ( ) : boolean
getHeaderIcon ( ) : string Returns the icon of the header.
getHeaderTitle ( ) : string Returns the title of the header.
getIcon ( ) : string Returns the action of the NavigationItem.
getId ( ) : string Returns the id of the NavigationItem.
getName ( ) : string Returns the name being displayed in the navigation.
getPosition ( ) : integer
hasChildren ( ) : boolean Checks if the NavigationItem has some children.
key ( ) : mixed Return the key of the current element.
merge ( NavigationItem $other = null ) : NavigationItem Merges this navigation item with the other parameter and returns a new NavigationItem.
next ( ) Move forward to next element.
rewind ( ) Rewind the Iterator to the first element.
setAction ( string $action ) Sets the action of the NavigationItem.
setDisabled ( boolean $disabled )
setEvent ( string $event )
setEventArguments ( $eventArguments )
setHasSettings ( boolean $hasSettings )
setHeaderIcon ( string $headerIcon ) Sets the icon of the header.
setHeaderTitle ( string $headerTitle ) Sets the title of the header.
setIcon ( string $icon ) Set the icon of the NavigaitonItem.
setId ( string $id ) Sets the id of the NavigationItem.
setName ( string $name ) Sets the name being displayed in the navigation.
setPosition ( integer $position )
toArray ( ) : array Returns the content of the NavigationItem as array.
valid ( ) : boolean Checks if current position is valid.

Protected Methods

Method Description
copyWithName ( ) : NavigationItem Create a new instance of current navigation item class.

Method Details

__construct() public method

public __construct ( string $name, NavigationItem $parent = null )
$name string The name of the item
$parent NavigationItem The parent of the item

addChild() public method

Adds a child to the navigation item.
public addChild ( NavigationItem $child )
$child NavigationItem

copyChildless() public method

Returns a copy of this navigation item without its children.
public copyChildless ( ) : NavigationItem
return NavigationItem

copyWithName() protected method

Create a new instance of current navigation item class.
protected copyWithName ( ) : NavigationItem
return NavigationItem

current() public method

Return the current element.
public current ( ) : mixed
return mixed Can return any type

equalsChildless() public method

Compares this item with another one, but doesn't check the children.
public equalsChildless ( NavigationItem $other ) : boolean
$other NavigationItem The other NavigationItem of the comparison
return boolean True if the NavigationItems are equal, otherwise false

find() public method

Searches for the equivalent of a specific NavigationItem.
public find ( NavigationItem $navigationItem ) : NavigationItem
$navigationItem NavigationItem The NavigationItem to look for
return NavigationItem The item if it is found, otherwise false

findChildren() public method

Searches for a specific NavigationItem in the children of this NavigationItem.
public findChildren ( NavigationItem $navigationItem ) : NavigationItem | null
$navigationItem NavigationItem The navigationItem we look for
return NavigationItem | null Null if the NavigationItem is not found, otherwise the found NavigationItem

getAction() public method

Returns the action of the NavigationItem.
public getAction ( ) : string
return string

getChildren() public method

Returns all children from this navigation item.
public getChildren ( ) : array
return array

getDisabled() public method

public getDisabled ( ) : boolean
return boolean

getEvent() public method

public getEvent ( ) : string
return string

getEventArguments() public method

public getEventArguments ( ) : string
return string

getHasSettings() public method

public getHasSettings ( ) : boolean
return boolean

getHeaderIcon() public method

Returns the icon of the header.
public getHeaderIcon ( ) : string
return string

getHeaderTitle() public method

Returns the title of the header.
public getHeaderTitle ( ) : string
return string The title of the header

getIcon() public method

Returns the action of the NavigationItem.
public getIcon ( ) : string
return string

getId() public method

Returns the id of the NavigationItem.
public getId ( ) : string
return string

getName() public method

Returns the name being displayed in the navigation.
public getName ( ) : string
return string

getPosition() public method

public getPosition ( ) : integer
return integer

hasChildren() public method

Checks if the NavigationItem has some children.
public hasChildren ( ) : boolean
return boolean True if the item has children, otherwise false

key() public method

Return the key of the current element.
public key ( ) : mixed
return mixed scalar on success, or null on failure

merge() public method

Works only if there are no duplicate values on one level.
public merge ( NavigationItem $other = null ) : NavigationItem
$other NavigationItem The navigation item this one should be merged with
return NavigationItem

next() public method

Move forward to next element.
public next ( )

rewind() public method

Rewind the Iterator to the first element.
public rewind ( )

setAction() public method

Sets the action of the NavigationItem.
public setAction ( string $action )
$action string The action of the NavigationItem

setDisabled() public method

public setDisabled ( boolean $disabled )
$disabled boolean

setEvent() public method

public setEvent ( string $event )
$event string

setEventArguments() public method

public setEventArguments ( $eventArguments )

setHasSettings() public method

public setHasSettings ( boolean $hasSettings )
$hasSettings boolean

setHeaderIcon() public method

Sets the icon of the header.
public setHeaderIcon ( string $headerIcon )
$headerIcon string

setHeaderTitle() public method

Sets the title of the header.
public setHeaderTitle ( string $headerTitle )
$headerTitle string The title of the header

setIcon() public method

Set the icon of the NavigaitonItem.
public setIcon ( string $icon )
$icon string The icon of the NavigationItem

setId() public method

Sets the id of the NavigationItem.
public setId ( string $id )
$id string

setName() public method

Sets the name being displayed in the navigation.
public setName ( string $name )
$name string The name being displayed in the navigation

setPosition() public method

public setPosition ( integer $position )
$position integer

toArray() public method

Returns the content of the NavigationItem as array.
public toArray ( ) : array
return array

valid() public method

Checks if current position is valid.
public valid ( ) : boolean
return boolean The return value will be casted to boolean and then evaluated. Returns true on success or false on failure

Property Details

$action protected property

The action which should be executed when clicking on this NavigationItem.
protected string $action
return string

$children protected property

Contains the children of this item, which are other NavigationItems.
protected array $children
return array

$disabled protected property

Defines if item is disabled.
protected bool $disabled
return boolean

$displayOption protected property

Describes how the navigation item should be shown in husky.
protected string $displayOption
return string

$hasSettings protected property

Defines if this menu item has settings.
protected bool $hasSettings
return boolean

$headerIcon protected property

The icon of the header are of the NavigationItem.
protected string $headerIcon
return string

$headerTitle protected property

The title of the head area of the NavigationItem.
protected string $headerTitle
return string

$icon protected property

The icon of the navigationItem.
protected string $icon
return string

$id protected property

The id of the NavigationItem.
protected string $id
return string

$name protected property

The name being displayed in the navigation.
protected string $name
return string

$position protected property

The current position of the iterator.
protected int $position
return integer