__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');
string
method name
array
method 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\self
fluent 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\self
fluent interface, returns selfcount() : int
Implements Countable interface.
int
number of pages in the containercurrent() : \Zend\Navigation\Page\AbstractPage
Implements RecursiveIterator interface.
\Zend\Navigation\Exception\OutOfBoundsException |
if the index is invalid |
---|
\Zend\Navigation\Page\AbstractPage
current page or nullfindAllBy(string $property, mixed $value) : array
string
name of property to match against
mixed
value to match property against
array
array containing only Page\AbstractPage instancesfindBy(string $property, mixed $value, bool $all) : \Zend\Navigation\Page\AbstractPage | null
string
name of property to match against
mixed
value 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\AbstractPage
null
matching page or nullfindOneBy(string $property, mixed $value) : \Zend\Navigation\Page\AbstractPage | null
string
name of property to match against
mixed
value to match property against
\Zend\Navigation\Page\AbstractPage
null
matching page or nullgetPages() : array
array
array of Page\AbstractPage instanceshasChildren() : bool
Implements RecursiveIterator interface.
bool
whether container has any pageshasPage(\Zend\Navigation\Page\AbstractPage $page, bool $recursive) : bool
bool
[optional] whether to search recursively. Default is false.
bool
whether page is in containerhasPages(bool $onlyVisible) : bool
bool
whether to check only visible pages
bool
whether container has any pageskey() : string
Implements RecursiveIterator interface.
string
hash code of current pagenext() : void
Implements RecursiveIterator interface.
notifyOrderUpdated() : void
removePage(\Zend\Navigation\Page\AbstractPage | int $page, bool $recursive) : bool
\Zend\Navigation\Page\AbstractPageint
page to remove, either a page instance or a specific page order
bool
[optional] whether to remove recursively
bool
whether the removal was successfulremovePages() : \Zend\Navigation\self
\Zend\Navigation\self
fluent interface, returns selfrewind() : void
Implements RecursiveIterator interface.
setPages(array $pages) : \Zend\Navigation\self
array
pages to set
\Zend\Navigation\self
fluent interface, returns selftoArray() : array
array
valid() : bool
Implements RecursiveIterator interface.
bool
sort() : void
$dirtyIndex : bool
$index : array
$pages : array