| Navigation | |
| Author | Rich Joslin |
| License | http://communit.as/docs/license |
| See Also | |
| Instance Variables | |
| $_name | The name of the table or view to interact with in the data source. |
| $_primary | The primary key of the table or view to interact with in the data source. |
| $role_id | |
| Constructors | |
| Navigation | Calls the parent’s constructor and sets the private role_id variable. |
| Instance Methods | |
| getNavTree | Returns a full tree (very jagged multidimensional array) of all navigation items that apply to the given role. |
| buildRecursiveNav | This is a recursive function that iterates through the supplied array, figures out if there are children, and either continues parsing the children (recursively), or assigns the results to the supplied parent (if the current recursion is complete). |
| getNavArrayByParentId | |
| hasChildren | Determines if a nav item has children. |
private function buildRecursiveNav( $parent_item, $nav_items )
This is a recursive function that iterates through the supplied array, figures out if there are children, and either continues parsing the children (recursively), or assigns the results to the supplied parent (if the current recursion is complete).
| nav_items | An array of nav items as pulled from the database using getNavArrayByParentId. |
| parent_item | The item to which to add children if any are found. |
Returns: An array of nav items along with any descendants they have (i.e.: a tree, or multidimensional array).
The name of the table or view to interact with in the data source.
protected $_name
The primary key of the table or view to interact with in the data source.
protected $_primary
public $role_id
Calls the parent’s constructor and sets the private role_id variable.
function Navigation( $role_id, $config = null )
Returns a full tree (very jagged multidimensional array) of all navigation items that apply to the given role.
function getNavTree()
This is a recursive function that iterates through the supplied array, figures out if there are children, and either continues parsing the children (recursively), or assigns the results to the supplied parent (if the current recursion is complete).
private function buildRecursiveNav( $parent_item, $nav_items )
function getNavArrayByParentId( $parent_id )
Determines if a nav item has children.
function hasChildren( $nav_id )