Moodle  2.2.1
http://www.collinsharper.com
navigation_node_collection Class Reference

Public Member Functions

 add (navigation_node $node, $beforekey=null)
 get_key_list ()
 get ($key, $type=null)
 find ($key, $type=null)
 last ()
 type ($type)
 remove ($key, $type=null)
 count ()
 getIterator ()

Protected Attributes

 $collection = array()
 $orderedcollection = array()
 $last = null
 $count = 0

Detailed Description

Definition at line 689 of file navigationlib.php.


Member Function Documentation

add ( navigation_node node,
beforekey = null 
)

Adds a navigation node to the collection

Parameters:
navigation_node$nodeNode to add
string$beforekeyIf specified, adds before a node with this key, otherwise adds at end
Returns:
navigation_node Added node

Definition at line 721 of file navigationlib.php.

Here is the call graph for this function:

count ( )

Gets the number of nodes in this collection

This option uses an internal count rather than counting the actual options to avoid a performance hit through the count function.

Returns:
int

Definition at line 895 of file navigationlib.php.

Here is the caller graph for this function:

find ( key,
type = null 
)

Searches for a node with matching key and type.

This function searches both the nodes in this collection and all of the nodes in each collection belonging to the nodes in this collection.

Recursive.

Parameters:
string | int$keyThe key of the node we want to find.
int$typeOne of navigation_node::TYPE_*.
Returns:
navigation_node|null

Definition at line 824 of file navigationlib.php.

Here is the call graph for this function:

get ( key,
type = null 
)

Fetches a node from this collection.

Parameters:
string | int$keyThe key of the node we want to find.
int$typeOne of navigation_node::TYPE_*.
Returns:
navigation_node|null

Definition at line 795 of file navigationlib.php.

Return a list of all the keys of all the nodes.

Returns:
array the keys.

Definition at line 780 of file navigationlib.php.

Here is the caller graph for this function:

Gets an array iterator for the collection.

This is required by the IteratorAggregator interface and is used by routines such as the foreach loop.

Returns:
ArrayIterator

Definition at line 906 of file navigationlib.php.

Here is the caller graph for this function:

last ( )

Fetches the last node that was added to this collection

Returns:
navigation_node

Definition at line 851 of file navigationlib.php.

Here is the caller graph for this function:

remove ( key,
type = null 
)

Removes the node with the given key and type from the collection

Parameters:
string | int$key
int$type
Returns:
bool

Definition at line 871 of file navigationlib.php.

Here is the call graph for this function:

type ( type)

Fetches all nodes of a given type from this collection

Definition at line 858 of file navigationlib.php.


Field Documentation

$collection = array() [protected]

Definition at line 695 of file navigationlib.php.

$count = 0 [protected]

Definition at line 711 of file navigationlib.php.

$last = null [protected]

Definition at line 706 of file navigationlib.php.

$orderedcollection = array() [protected]

Definition at line 701 of file navigationlib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations