Zend Framework
2.4
|
Public Member Functions | |
notifyOrderUpdated () | |
Notifies container that the order of pages are updated. | |
addPage ($page) | |
Adds a page to the container. | |
addPages ($pages) | |
Adds several pages at once. | |
setPages (array $pages) | |
Sets pages this container should have, removing existing pages. | |
getPages () | |
Returns pages in the container. | |
removePages () | |
Removes all pages in container. | |
hasPage (Page\AbstractPage $page, $recursive=false) | |
Checks if the container has the given page. | |
hasPages ($onlyVisible=false) | |
Returns true if container contains any pages. | |
findOneBy ($property, $value) | |
Returns a child page matching $property == $value, or null if not found. | |
findAllBy ($property, $value) | |
Returns all child pages matching $property == $value, or an empty array if no pages are found. | |
findBy ($property, $value, $all=false) | |
Returns page(s) matching $property == $value. | |
__call ($method, $arguments) | |
Magic overload: Proxy calls to finder methods. | |
toArray () | |
Returns an array representation of all pages in container. | |
current () | |
Returns current page. | |
key () | |
Returns hash code of current page. | |
next () | |
Moves index pointer to next page in the container. | |
rewind () | |
Sets index pointer to first page in the container. | |
valid () | |
Checks if container index is valid. | |
hasChildren () | |
Proxy to hasPages() | |
getChildren () | |
Returns the child container. | |
count () | |
Returns number of pages in container. | |
Protected Member Functions | |
sort () | |
Sorts the page index according to page order. | |
Protected Attributes | |
$pages = array() | |
$index = array() | |
$dirtyIndex = false | |
Zend.
AbstractContainer class for Zend classes.
__call | ( | $method, | |
$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');
string | $method | method name |
array | $arguments | method arguments |
Exception\BadMethodCallException | if method does not exist |
addPage | ( | $page | ) |
Adds a page to the container.
This method will inject the container as the given page's parent by calling ::setParent().
Page\AbstractPage | array | Traversable | $page | page to add |
Exception\InvalidArgumentException | if page is invalid |
addPages | ( | $pages | ) |
Adds several pages at once.
array | Traversable | AbstractContainer | $pages | pages to add |
Exception\InvalidArgumentException | if $pages is not array, Traversable or AbstractContainer |
count | ( | ) |
Returns number of pages in container.
Implements Countable interface.
current | ( | ) |
Returns current page.
Implements RecursiveIterator interface.
Exception\OutOfBoundsException | if the index is invalid |
findAllBy | ( | $property, | |
$value | |||
) |
Returns all child pages matching $property == $value, or an empty array if no pages are found.
string | $property | name of property to match against |
mixed | $value | value to match property against |
findBy | ( | $property, | |
$value, | |||
$all = false |
|||
) |
Returns page(s) matching $property == $value.
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 | ( | $property, | |
$value | |||
) |
Returns a child page matching $property == $value, or null if not found.
string | $property | name of property to match against |
mixed | $value | value to match property against |
getChildren | ( | ) |
getPages | ( | ) |
Returns pages in the container.
hasChildren | ( | ) |
Proxy to hasPages()
Implements RecursiveIterator interface.
hasPage | ( | Page\AbstractPage | $page, |
$recursive = false |
|||
) |
Checks if the container has the given page.
Page\AbstractPage | $page | page to look for |
bool | $recursive | [optional] whether to search recursively. Default is false. |
hasPages | ( | $onlyVisible = false | ) |
Returns true if container contains any pages.
bool | $onlyVisible | whether to check only visible pages |
key | ( | ) |
Returns hash code of current page.
Implements RecursiveIterator interface.
next | ( | ) |
Moves index pointer to next page in the container.
Implements RecursiveIterator interface.
notifyOrderUpdated | ( | ) |
Notifies container that the order of pages are updated.
removePages | ( | ) |
Removes all pages in container.
rewind | ( | ) |
Sets index pointer to first page in the container.
Implements RecursiveIterator interface.
setPages | ( | array | $pages | ) |
Sets pages this container should have, removing existing pages.
array | $pages | pages to set |
|
protected |
Sorts the page index according to page order.
toArray | ( | ) |
Returns an array representation of all pages in container.
valid | ( | ) |
Checks if container index is valid.
Implements RecursiveIterator interface.
|
protected |
|
protected |
|
protected |