Navigation.php

Show: PublicProtectedPrivateinherited
Table of Contents
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Navigation  
Version
$Id: Navigation.php 25024 2012-07-30 15:08:15Z rob $  

\Zend_Navigation

Package: Zend\Navigation
A simple container class for {@link Zend_Navigation_Page} pages

Container class for Zend_Navigation_Page classes.

Parent(s)
\Zend_Navigation_Container
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedbool $_dirtyIndex = false
inherited
Whether index is dirty and needs to be re-arranged
Inherited from: \Zend_Navigation_Container::$$_dirtyIndex
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Navigation_Container::$$_dirtyIndex  
>VPropertyprotectedarray $_index = array()
inherited
An index that contains the order in which to iterate pages
Inherited from: \Zend_Navigation_Container::$$_index
Default valuearray()Details
Type
array
Inherited_from
\Zend_Navigation_Container::$$_index  
>VPropertyprotectedarray $_pages = array()
inherited
Contains sub pages
Inherited from: \Zend_Navigation_Container::$$_pages
Default valuearray()Details
Type
array
Inherited_from
\Zend_Navigation_Container::$$_pages  

Methods

methodpublic__call(string $method, array $arguments) : mixed
inherited

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->findByLabel('/foo/', true); // $nav->findBy('label', '/foo/', true);
$nav->findOneByLabel('foo');      // $nav->findOneBy('label', 'foo');
$nav->findAllByClass('foo');      // $nav->findAllBy('class', 'foo');
Parameters
NameTypeDescription
$methodstring

method name

$argumentsarray

method arguments

Returns
TypeDescription
mixedZend_Navigation|array|null matching page, array of pages or null
Throws
ExceptionDescription
\Zend_Navigation_Exceptionif method does not exist
methodpublic__construct(array | \Zend_Config $pages = null) : void

Creates a new navigation container

Parameters
NameTypeDescription
$pagesarray | \Zend_Config

[optional] pages to add

Throws
ExceptionDescription
\Zend_Navigation_Exceptionif $pages is invalid
methodprotected_sort() : void
inherited

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
inherited

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 Zend_Navigation_Page::setParent().

Parameters
NameTypeDescription
$page\Zend_Navigation_Page | array | \Zend_Config

page to add

Returns
TypeDescription
\Zend_Navigation_Containerfluent interface, returns self
Throws
ExceptionDescription
\Zend_Navigation_Exceptionif page is invalid
methodpublicaddPages(array | \Zend_Config | \Zend_Navigation_Container $pages) : \Zend_Navigation_Container
inherited

Adds several pages at once

Inherited from: \Zend_Navigation_Container::addPages()
Parameters
NameTypeDescription
$pagesarray | \Zend_Config | \Zend_Navigation_Container

pages to add

Returns
TypeDescription
\Zend_Navigation_Containerfluent interface, returns self
Throws
ExceptionDescription
\Zend_Navigation_Exceptionif $pages is not array, Zend_Config or Zend_Navigation_Container
methodpubliccount() : int
inherited

Returns number of pages in container

Inherited from: \Zend_Navigation_Container::count()

Implements Countable interface.

Returns
TypeDescription
intnumber of pages in the container
methodpubliccurrent() : \Zend_Navigation_Page
inherited

Returns current page

Inherited from: \Zend_Navigation_Container::current()

Implements RecursiveIterator interface.

Returns
TypeDescription
\Zend_Navigation_Pagecurrent page or null
Throws
ExceptionDescription
\Zend_Navigation_Exceptionif the index is invalid
methodpublicfindAllBy(string $property, mixed $value, bool $useRegex = false) : array
inherited

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

Inherited from: \Zend_Navigation_Container::findAllBy()
Parameters
NameTypeDescription
$propertystring

name of property to match against

$valuemixed

value to match property against

$useRegexbool

[optional] if true PHP's preg_match is used. Default is false.

Returns
TypeDescription
arrayarray containing only Zend_Navigation_Page instances
methodpublicfindBy(string $property, mixed $value, bool $all = false, bool $useRegex = false) : \Zend_Navigation_Page | null
inherited

Returns page(s) matching $property == $value or preg_match($value, $property)

Inherited from: \Zend_Navigation_Container::findBy()
Parameters
NameTypeDescription
$propertystring

name of property to match against

$valuemixed

value to match property against

$allbool

[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.

$useRegexbool

[optional] if true PHP's preg_match is used. Default is false.

Returns
TypeDescription
\Zend_Navigation_Page | nullmatching page or null
methodpublicfindOneBy(string $property, mixed $value, bool $useRegex = false) : \Zend_Navigation_Page | null
inherited

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

Inherited from: \Zend_Navigation_Container::findOneBy()
Parameters
NameTypeDescription
$propertystring

name of property to match against

$valuemixed

value to match property against

$useRegexbool

[optional] if true PHP's preg_match is used. Default is false.

Returns
TypeDescription
\Zend_Navigation_Page | nullmatching page or null
methodpublicgetChildren() : \Zend_Navigation_Page | null
inherited

Returns the child container.

Inherited from: \Zend_Navigation_Container::getChildren()

Implements RecursiveIterator interface.

Returns
TypeDescription
\Zend_Navigation_Page | null
methodpublicgetPages() : array
inherited

Returns pages in the container

Inherited from: \Zend_Navigation_Container::getPages()
Returns
TypeDescription
arrayarray of Zend_Navigation_Page instances
methodpublichasChildren() : bool
inherited

Proxy to hasPages()

Inherited from: \Zend_Navigation_Container::hasChildren()

Implements RecursiveIterator interface.

Returns
TypeDescription
boolwhether container has any pages
methodpublichasPage(\Zend_Navigation_Page $page, bool $recursive = false) : bool
inherited

Checks if the container has the given page

Inherited from: \Zend_Navigation_Container::hasPage()
Parameters
NameTypeDescription
$page\Zend_Navigation_Page

page to look for

$recursivebool

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

Returns
TypeDescription
boolwhether page is in container
methodpublichasPages() : bool
inherited

Returns true if container contains any pages

Inherited from: \Zend_Navigation_Container::hasPages()
Returns
TypeDescription
boolwhether container has any pages
methodpublickey() : string
inherited

Returns hash code of current page

Inherited from: \Zend_Navigation_Container::key()

Implements RecursiveIterator interface.

Returns
TypeDescription
stringhash code of current page
methodpublicnext() : void
inherited

Moves index pointer to next page in the container

Inherited from: \Zend_Navigation_Container::next()

Implements RecursiveIterator interface.

methodpublicnotifyOrderUpdated() : void
inherited

Notifies container that the order of pages are updated

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

Removes the given page from the container

Inherited from: \Zend_Navigation_Container::removePage()
Parameters
NameTypeDescription
$page\Zend_Navigation_Page | int

page to remove, either a page instance or a specific page order

Returns
TypeDescription
boolwhether the removal was successful
methodpublicremovePages() : \Zend_Navigation_Container
inherited

Removes all pages in container

Inherited from: \Zend_Navigation_Container::removePages()
Returns
TypeDescription
\Zend_Navigation_Containerfluent interface, returns self
methodpublicrewind() : void
inherited

Sets index pointer to first page in the container

Inherited from: \Zend_Navigation_Container::rewind()

Implements RecursiveIterator interface.

methodpublicsetPages(array $pages) : \Zend_Navigation_Container
inherited

Sets pages this container should have, removing existing pages

Inherited from: \Zend_Navigation_Container::setPages()
Parameters
NameTypeDescription
$pagesarray

pages to set

Returns
TypeDescription
\Zend_Navigation_Containerfluent interface, returns self
methodpublictoArray() : array
inherited

Returns an array representation of all pages in container

Inherited from: \Zend_Navigation_Container::toArray()
Returns
TypeDescription
array
methodpublicvalid() : bool
inherited

Checks if container index is valid

Inherited from: \Zend_Navigation_Container::valid()

Implements RecursiveIterator interface.

Returns
TypeDescription
bool
Documentation was generated by phpDocumentor 2.0.0a12.