API Documentation

Navigation/Container.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Navigation
version
$Id: Container.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Navigation_Container

Description

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.

Zend_Navigation_Container

Implements
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Navigation
Properties
$_pages
$_index
$_dirtyIndex
Methods
_sort
notifyOrderUpdated
addPage
addPages
setPages
getPages
removePage
removePages
hasPage
hasPages
findOneBy
findAllBy
findBy
__call
toArray
current
key
next
rewind
valid
hasChildren
getChildren
count

Description

Zend_Navigation_Container

Container class for Zend_Navigation_Page classes.

Properties

$_dirtyIndex

bool $_dirtyIndex = 'false'

Whether index is dirty and needs to be re-arranged

Details

$_dirtyIndex
bool
visibility
protected
default
false
final
false
static
false

$_index

array $_index = 'array'

An index that contains the order in which to iterate pages

Details

$_index
array
visibility
protected
default
array
final
false
static
false

$_pages

array $_pages = 'array'

Contains sub pages

Details

$_pages
array
visibility
protected
default
array
final
false
static
false

Methods

__call

__call( string $method, array $arguments ) :

Magic overload: Proxy calls to finder methods

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');

Arguments
$method
string
method name
$arguments
array
method arguments
Details
visibility
public
final
false
static
false
throws
if method does not exist

_sort

_sort( ) : void

Sorts the page index according to page order

Details
visibility
protected
final
false
static
false

addPage

addPage( Zend_Navigation_Page|array|Zend_Config $page ) : Zend_Navigation_Container

Adds a page to the container

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

Arguments
$page
Zend_Navigation_PagearrayZend_Config
page to add
Output
Zend_Navigation_Container
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if page is invalid

addPages

addPages( array|Zend_Config $pages ) : Zend_Navigation_Container

Adds several pages at once

Arguments
$pages
arrayZend_Config
pages to add
Output
Zend_Navigation_Container
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if $pages is not array or Zend_Config

count

count( ) : int

Returns number of pages in container

Implements Countable interface.

Output
int
number of pages in the container
Details
visibility
public
final
false
static
false

current

current( ) : Zend_Navigation_Page

Returns current page

Implements RecursiveIterator interface.

Output
Zend_Navigation_Page
current page or null
Details
visibility
public
final
false
static
false
throws
if the index is invalid

findAllBy

findAllBy( string $property, mixed $value ) : array

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

Arguments
$property
string
name of property to match against
$value
mixed
value to match property against
Output
array
array containing only Zend_Navigation_Page instances
Details
visibility
public
final
false
static
false

findBy

findBy( string $property, mixed $value, bool $all = false ) : Zend_Navigation_Page|null

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

Arguments
$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.
Output
Zend_Navigation_Page|null
matching page or null
Details
visibility
public
final
false
static
false

findOneBy

findOneBy( string $property, mixed $value ) : Zend_Navigation_Page|null

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

Arguments
$property
string
name of property to match against
$value
mixed
value to match property against
Output
Zend_Navigation_Page|null
matching page or null
Details
visibility
public
final
false
static
false

getChildren

getChildren( ) : Zend_Navigation_Page|null

Returns the child container.

Implements RecursiveIterator interface.

Output
Zend_Navigation_Page|null
Details
visibility
public
final
false
static
false

getPages

getPages( ) : array

Returns pages in the container

Output
array
array of Zend_Navigation_Page instances
Details
visibility
public
final
false
static
false

hasChildren

hasChildren( ) : bool

Proxy to hasPages()

Implements RecursiveIterator interface.

Output
bool
whether container has any pages
Details
visibility
public
final
false
static
false

hasPage

hasPage( Zend_Navigation_Page $page, bool $recursive = false ) : bool

Checks if the container has the given page

Arguments
$page
Zend_Navigation_Page
page to look for
$recursive
bool
[optional] whether to search recursively. Default is false.
Output
bool
whether page is in container
Details
visibility
public
final
false
static
false

hasPages

hasPages( ) : bool

Returns true if container contains any pages

Output
bool
whether container has any pages
Details
visibility
public
final
false
static
false

key

key( ) : string

Returns hash code of current page

Implements RecursiveIterator interface.

Output
string
hash code of current page
Details
visibility
public
final
false
static
false

next

next( ) : void

Moves index pointer to next page in the container

Implements RecursiveIterator interface.

Details
visibility
public
final
false
static
false

notifyOrderUpdated

notifyOrderUpdated( ) : void

Notifies container that the order of pages are updated

Details
visibility
public
final
false
static
false

removePage

removePage( Zend_Navigation_Page|int $page ) : bool

Removes the given page from the container

Arguments
$page
Zend_Navigation_Pageint
page to remove, either a page instance or a specific page order
Output
bool
whether the removal was successful
Details
visibility
public
final
false
static
false

removePages

removePages( ) : Zend_Navigation_Container

Removes all pages in container

Output
Zend_Navigation_Container
fluent interface, returns self
Details
visibility
public
final
false
static
false

rewind

rewind( ) : void

Sets index pointer to first page in the container

Implements RecursiveIterator interface.

Details
visibility
public
final
false
static
false

setPages

setPages( array $pages ) : Zend_Navigation_Container

Sets pages this container should have, removing existing pages

Arguments
$pages
array
pages to set
Output
Zend_Navigation_Container
fluent interface, returns self
Details
visibility
public
final
false
static
false

toArray

toArray( ) : array

Returns an array representation of all pages in container

Output
array
Details
visibility
public
final
false
static
false

valid

valid( ) : bool

Checks if container index is valid

Implements RecursiveIterator interface.

Output
bool
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.