Zeta Components Manual :: Docs For Class ezcTreeNodeList
Tree::ezcTreeNodeList
Class ezcTreeNodeList
ezcTreeNodeList represents a lists of nodes.
The nodes in the list can be accessed through an array as this class implements the ArrayAccess SPL interface. The array is indexed based on the the node's ID.
Example:
- <?php
- // Create a list with two elements
- // Retrieve the list's size
- echo $list->size, "\n"; // prints 2
- // Find a node in the list
- $node = $list['Virgo'];
- // Add nodes in an alternative way
- // Remove a node from the list
- unset( $list['Leo'] );
- // Checking if a node exists
- if ( isset( $list['Scorpius'] ) )
- {
- // do something if it exists
- }
- // Use the associated data store to fetch the data for all nodes at once
- ?>
Source for this file: /Tree/src/tree_node_list.php
Implements interfaces:
- ArrayAccess (internal interface)
Version: | //autogentag// |
Properties
array(string=>ezcTreeNode) | read |
$nodes
The nodes belonging to this list. |
string | read |
$size
The number of nodes in the list. |
Method Summary
public ezcTreeNodeList |
__construct(
)
Constructs a new ezcTreeNodeList object. |
public void |
addNode(
$node
)
Adds the node $node to the list. |
public void |
fetchDataForNodes(
)
Fetches data for all nodes in the node list. |
Methods
__construct
ezcTreeNodeList
__construct(
)
Constructs a new ezcTreeNodeList object.
addNode
void
addNode(
ezcTreeNode
$node
)
Adds the node $node to the list.
Parameters:
Name | Type | Description |
---|---|---|
$node |
ezcTreeNode |
fetchDataForNodes
void
fetchDataForNodes(
)
Fetches data for all nodes in the node list.
Documentation generated by phpDocumentor 1.4.3