__call()
addPage()
addPages()
count()
current()
findAllBy()
findBy()
findOneBy()
getChildren()
getPages()
hasChildren()
hasPage()
hasPages()
key()
next()
notifyOrderUpdated()
removePage()
removePages()
rewind()
setPages()
toArray()
valid()
sort()
$dirtyIndex
$index
$pages
Zend\Navigation\Container
AbstractContainer class for Zend\Navigation\Page classes.
__call(string $method, array $arguments)
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');
stringmethod name
arraymethod arguments
\Zend\Navigation\Exception\BadMethodCallException |
if method does not exist |
|---|
addPage(\Zend\Navigation\Page\AbstractPage | array | \Traversable $page) : \Zend\Navigation\self
This method will inject the container as the given page's parent by calling Page\AbstractPage::setParent().
\Zend\Navigation\Exception\InvalidArgumentException |
if page is invalid |
|---|
\Zend\Navigation\selffluent interface, returns selfaddPages(array | \Traversable | \Zend\Navigation\AbstractContainer $pages) : \Zend\Navigation\self
\Zend\Navigation\Exception\InvalidArgumentException |
if $pages is not array, Traversable or AbstractContainer |
|---|
\Zend\Navigation\selffluent interface, returns selfcount() : int
Implements Countable interface.
intnumber of pages in the containercurrent() : \Zend\Navigation\Page\AbstractPage
Implements RecursiveIterator interface.
\Zend\Navigation\Exception\OutOfBoundsException |
if the index is invalid |
|---|
\Zend\Navigation\Page\AbstractPagecurrent page or nullfindAllBy(string $property, mixed $value) : array
stringname of property to match against
mixedvalue to match property against
arrayarray containing only Page\AbstractPage instancesfindBy(string $property, mixed $value, bool $all) : \Zend\Navigation\Page\AbstractPage | null
stringname of property to match against
mixedvalue to match property against
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.
\Zend\Navigation\Page\AbstractPagenullmatching page or nullfindOneBy(string $property, mixed $value) : \Zend\Navigation\Page\AbstractPage | null
stringname of property to match against
mixedvalue to match property against
\Zend\Navigation\Page\AbstractPagenullmatching page or nullgetPages() : array
arrayarray of Page\AbstractPage instanceshasChildren() : bool
Implements RecursiveIterator interface.
boolwhether container has any pageshasPage(\Zend\Navigation\Page\AbstractPage $page, bool $recursive) : bool
bool[optional] whether to search recursively. Default is false.
boolwhether page is in containerhasPages(bool $onlyVisible) : bool
boolwhether to check only visible pages
boolwhether container has any pageskey() : string
Implements RecursiveIterator interface.
stringhash code of current pagenext() : void
Implements RecursiveIterator interface.
notifyOrderUpdated() : void
removePage(\Zend\Navigation\Page\AbstractPage | int $page, bool $recursive) : bool
\Zend\Navigation\Page\AbstractPageintpage to remove, either a page instance or a specific page order
bool[optional] whether to remove recursively
boolwhether the removal was successfulremovePages() : \Zend\Navigation\self
\Zend\Navigation\selffluent interface, returns selfrewind() : void
Implements RecursiveIterator interface.
setPages(array $pages) : \Zend\Navigation\self
arraypages to set
\Zend\Navigation\selffluent interface, returns selftoArray() : array
arrayvalid() : bool
Implements RecursiveIterator interface.
boolsort() : void
$dirtyIndex : bool
$index : array
$pages : array