API Documentation

Navigation.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Navigation  
version
$Id: Navigation.php 23953 2011-05-03 05:47:39Z ralph $  

\Zend_Navigation

A simple container class for {@link Zend_Navigation_Page} pages

Container class for Zend_Navigation_Page classes.

Extends from
\Zend_Navigation_Container
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Navigation  

Methods

methodpublic__call( string $method, array $arguments ) : void

Magic overload: Proxy calls to finder methods

Inherited from: \Zend_Navigation_Container::__call()

Examples of finder calls:

// METHOD                    // SAME AS
$nav->findByLabel('foo');    // $nav->findOneBy('label', 'foo');
$nav->findOneByLabel('foo'); // $nav->findOneBy('label', 'foo');
$nav->findAllByClass('foo'); // $nav->findAllBy('class', 'foo');
Parameters
Name Type Description
$method string method name
$arguments array method arguments
Throws
Exception Description
\Zend_Navigation_Exception if method does not exist
methodpublic__construct( array|\Zend_Config $pages = null ) : void

Creates a new navigation container

Parameters
Name Type Description
$pages array|\Zend_Config

[optional] pages to add

Throws
Exception Description
\Zend_Navigation_Exception if $pages is invalid
methodprotected_sort( ) : void

Sorts the page index according to page order

Inherited from: \Zend_Navigation_Container::_sort()
methodpublicaddPage( \Zend_Navigation_Page|array|\Zend_Config $page ) : \Zend_Navigation_Container

Adds a page to the container

Inherited from: \Zend_Navigation_Container::addPage()

This method will inject the container as the given page's parent by calling {@link Zend_Navigation_Page::setParent()}.

Parameters
Name Type Description
$page \Zend_Navigation_Page|array|\Zend_Config page to add
Returns
Type Description
\Zend_Navigation_Container fluent interface, returns self
Throws
Exception Description
\Zend_Navigation_Exception if page is invalid
methodpublicaddPages( array|\Zend_Config|\Zend_Navigation_Container $pages ) : \Zend_Navigation_Container

Adds several pages at once

Inherited from: \Zend_Navigation_Container::addPages()
Parameters
Name Type Description
$pages array|\Zend_Config|\Zend_Navigation_Container pages to add
Returns
Type Description
\Zend_Navigation_Container fluent interface, returns self
Throws
Exception Description
\Zend_Navigation_Exception if $pages is not array, Zend_Config or Zend_Navigation_Container
methodpubliccount( ) : int

Returns number of pages in container

Inherited from: \Zend_Navigation_Container::count()

Implements Countable interface.

Returns
Type Description
int number of pages in the container
methodpubliccurrent( ) : \Zend_Navigation_Page

Returns current page

Inherited from: \Zend_Navigation_Container::current()

Implements RecursiveIterator interface.

Returns
Type Description
\Zend_Navigation_Page current page or null
Throws
Exception Description
\Zend_Navigation_Exception if the index is invalid
methodpublicfindAllBy( string $property, mixed $value ) : array

Returns all child pages matching $property == $value, or an empty array if no pages are found

Inherited from: \Zend_Navigation_Container::findAllBy()
Parameters
Name Type Description
$property string name of property to match against
$value mixed value to match property against
Returns
Type Description
array array containing only Zend_Navigation_Page instances
methodpublicfindBy( string $property, mixed $value, bool $all = false ) : \Zend_Navigation_Page|null

Returns page(s) matching $property == $value

Inherited from: \Zend_Navigation_Container::findBy()
Parameters
Name Type Description
$property string name of property to match against
$value mixed value to match property against
$all bool

[optional] whether an array of all matching pages should be returned, or only the first. If true, an array will be returned, even if not matching pages are found. If false, null will be returned if no matching page is found. Default is false.

Returns
Type Description
\Zend_Navigation_Pagenull matching page or null
methodpublicfindOneBy( string $property, mixed $value ) : \Zend_Navigation_Page|null

Returns a child page matching $property == $value, or null if not found

Inherited from: \Zend_Navigation_Container::findOneBy()
Parameters
Name Type Description
$property string name of property to match against
$value mixed value to match property against
Returns
Type Description
\Zend_Navigation_Pagenull matching page or null
methodpublicgetChildren( ) : \Zend_Navigation_Page|null

Returns the child container.

Inherited from: \Zend_Navigation_Container::getChildren()

Implements RecursiveIterator interface.

Returns
Type Description
\Zend_Navigation_Pagenull
methodpublicgetPages( ) : array

Returns pages in the container

Inherited from: \Zend_Navigation_Container::getPages()
Returns
Type Description
array array of Zend_Navigation_Page instances
methodpublichasChildren( ) : bool

Proxy to hasPages()

Inherited from: \Zend_Navigation_Container::hasChildren()

Implements RecursiveIterator interface.

Returns
Type Description
bool whether container has any pages
methodpublichasPage( \Zend_Navigation_Page $page, bool $recursive = false ) : bool

Checks if the container has the given page

Inherited from: \Zend_Navigation_Container::hasPage()
Parameters
Name Type Description
$page \Zend_Navigation_Page page to look for
$recursive bool

[optional] whether to search recursively. Default is false.

Returns
Type Description
bool whether page is in container
methodpublichasPages( ) : bool

Returns true if container contains any pages

Inherited from: \Zend_Navigation_Container::hasPages()
Returns
Type Description
bool whether container has any pages
methodpublickey( ) : string

Returns hash code of current page

Inherited from: \Zend_Navigation_Container::key()

Implements RecursiveIterator interface.

Returns
Type Description
string hash code of current page
methodpublicnext( ) : void

Moves index pointer to next page in the container

Inherited from: \Zend_Navigation_Container::next()

Implements RecursiveIterator interface.

methodpublicnotifyOrderUpdated( ) : void

Notifies container that the order of pages are updated

Inherited from: \Zend_Navigation_Container::notifyOrderUpdated()
methodpublicremovePage( \Zend_Navigation_Page|int $page ) : bool

Removes the given page from the container

Inherited from: \Zend_Navigation_Container::removePage()
Parameters
Name Type Description
$page \Zend_Navigation_Page|int page to remove, either a page instance or a specific page order
Returns
Type Description
bool whether the removal was successful
methodpublicremovePages( ) : \Zend_Navigation_Container

Removes all pages in container

Inherited from: \Zend_Navigation_Container::removePages()
Returns
Type Description
\Zend_Navigation_Container fluent interface, returns self
methodpublicrewind( ) : void

Sets index pointer to first page in the container

Inherited from: \Zend_Navigation_Container::rewind()

Implements RecursiveIterator interface.

methodpublicsetPages( array $pages ) : \Zend_Navigation_Container

Sets pages this container should have, removing existing pages

Inherited from: \Zend_Navigation_Container::setPages()
Parameters
Name Type Description
$pages array pages to set
Returns
Type Description
\Zend_Navigation_Container fluent interface, returns self
methodpublictoArray( ) : array

Returns an array representation of all pages in container

Inherited from: \Zend_Navigation_Container::toArray()
Returns
Type Description
array
methodpublicvalid( ) : bool

Checks if container index is valid

Inherited from: \Zend_Navigation_Container::valid()

Implements RecursiveIterator interface.

Returns
Type Description
bool
Documentation was generated by DocBlox 0.13.3.