Abstract Class Zend_Navigation_Container

Description

Implements interfaces:

  • RecursiveIterator (internal interface)
  • Countable (internal interface)

Zend_Navigation_Container

Container class for Zend_Navigation_Page classes.

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /Navigation/Container.php (line 32)


	
			
Direct descendents
Class Description
Abstract class Zend_Navigation_Page Base class for Zend_Navigation_Page pages
 class Zend_Navigation A simple container class for Zend_Navigation_Page pages
Variable Summary
 array $_index
 array $_pages
Method Summary
 int count ()
 array findAllBy (string $property, mixed $value)
 Zend_Navigation_Page|null findBy (string $property, mixed $value, [bool $all = false])
 Zend_Navigation_Page|null findOneBy (string $property, mixed $value)
 array getPages ()
 bool hasChildren ()
 bool hasPage (Zend_Navigation_Page $page, [bool $recursive = false])
 bool hasPages ()
 string key ()
 void next ()
 bool removePage (Zend_Navigation_Page|int $page)
 void rewind ()
 array toArray ()
 bool valid ()
 void _sort ()
 void __call (string $method, array $arguments)
Variables
bool $_dirtyIndex = false (line 53)

Whether index is dirty and needs to be re-arranged

  • access: protected
array $_index = array() (line 46)

An index that contains the order in which to iterate pages

  • access: protected
array $_pages = array() (line 39)

Contains sub pages

  • access: protected
Methods
addPage (line 107)

Adds a page to the container

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

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if page is invalid
  • access: public
addPages (line 150)

Adds several pages at once

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if $pages is not array or Zend_Config
  • access: public
Zend_Navigation_Container addPages (array|Zend_Config $pages)
count (line 499)

Returns number of pages in container

Implements Countable interface.

  • return: number of pages in the container
  • access: public
int count ()

Implementation of:
Countable::count
current (line 392)

Returns current page

Implements RecursiveIterator interface.

  • return: current page or null
  • throws: Zend_Navigation_Exception if the index is invalid
  • access: public

Implementation of:
RecursiveIterator::current
findAllBy (line 298)

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

  • return: array containing only Zend_Navigation_Page instances
  • access: public
array findAllBy (string $property, mixed $value)
  • string $property: name of property to match against
  • mixed $value: value to match property against
findBy (line 327)

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

  • return: matching page or null
  • access: public
Zend_Navigation_Page|null findBy (string $property, mixed $value, [bool $all = false])
  • string $property: name of property to match against
  • mixed $value: value to match property against
  • bool $all: [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.
findOneBy (line 275)

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

  • return: matching page or null
  • access: public
Zend_Navigation_Page|null findOneBy (string $property, mixed $value)
  • string $property: name of property to match against
  • mixed $value: value to match property against
getChildren (line 479)

Returns the child container.

Implements RecursiveIterator interface.

  • access: public
Zend_Navigation_Page|null getChildren ()

Implementation of:
RecursiveIterator::getChildren
getPages (line 187)

Returns pages in the container

  • return: array of Zend_Navigation_Page instances
  • access: public
array getPages ()
hasChildren (line 467)

Proxy to hasPages()

Implements RecursiveIterator interface.

  • return: whether container has any pages
  • access: public
bool hasChildren ()

Implementation of:
RecursiveIterator::hasChildren
hasPage (line 243)

Checks if the container has the given page

  • return: whether page is in container
  • access: public
bool hasPage (Zend_Navigation_Page $page, [bool $recursive = false])
  • Zend_Navigation_Page $page: page to look for
  • bool $recursive: [optional] whether to search recursively. Default is false.
hasPages (line 263)

Returns true if container contains any pages

  • return: whether container has any pages
  • access: public
bool hasPages ()
key (line 415)

Returns hash code of current page

Implements RecursiveIterator interface.

  • return: hash code of current page
  • access: public
string key ()

Implementation of:
RecursiveIterator::key
next (line 428)

Moves index pointer to next page in the container

Implements RecursiveIterator interface.

  • access: public
void next ()

Implementation of:
RecursiveIterator::next
notifyOrderUpdated (line 91)

Notifies container that the order of pages are updated

  • access: public
void notifyOrderUpdated ()
removePage (line 200)

Removes the given page from the container

  • return: whether the removal was successful
  • access: public
bool removePage (Zend_Navigation_Page|int $page)
removePages (line 228)

Removes all pages in container

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Container removePages ()
rewind (line 441)

Sets index pointer to first page in the container

Implements RecursiveIterator interface.

  • access: public
void rewind ()

Implementation of:
RecursiveIterator::rewind
setPages (line 176)

Sets pages this container should have, removing existing pages

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Container setPages ( $pages)
  • array $pages: pages to set
toArray (line 369)

Returns an array representation of all pages in container

  • access: public
array toArray ()

Redefined in descendants as:
valid (line 454)

Checks if container index is valid

Implements RecursiveIterator interface.

  • access: public
bool valid ()

Implementation of:
RecursiveIterator::valid
_sort (line 62)

Sorts the page index according to page order

  • access: protected
void _sort ()
__call (line 351)

Magic overload: Proxy calls to finder methods

Examples of finder calls:

  1.  // METHOD                    // SAME AS
  2.  $nav->findByLabel('foo');    // $nav->findOneBy('label', 'foo');
  3.  $nav->findOneByLabel('foo')// $nav->findOneBy('label', 'foo');
  4.  $nav->findAllByClass('foo')// $nav->findAllBy('class', 'foo');

  • throws: Zend_Navigation_Exception if method does not exist
  • access: public
void __call (string $method, array $arguments)
  • string $method: method name
  • array $arguments: method arguments

Documentation generated on Mon, 21 Jun 2010 15:13:51 -0400 by phpDocumentor 1.4.3