__call()
__construct()
__get()
__isset()
__set()
__toString()
__unset()
addFactory()
addPage()
addPages()
addRel()
addRev()
count()
current()
factory()
findAllBy()
findBy()
findOneBy()
get()
getActive()
getChildren()
getClass()
getCustomProperties()
getDefinedRel()
getDefinedRev()
getFragment()
getHref()
getId()
getLabel()
getOrder()
getPages()
getParent()
getPermission()
getPrivilege()
getRel()
getResource()
getRev()
getTarget()
getTextDomain()
getTitle()
getVisible()
hasChildren()
hasPage()
hasPages()
hashCode()
isActive()
isVisible()
key()
next()
notifyOrderUpdated()
removePage()
removePages()
removeRel()
removeRev()
rewind()
set()
setActive()
setClass()
setFragment()
setId()
setLabel()
setOptions()
setOrder()
setPages()
setParent()
setPermission()
setPrivilege()
setRel()
setResource()
setRev()
setTarget()
setTextDomain()
setTitle()
setVisible()
toArray()
valid()
init()
normalizePropertyName()
sort()
$active
$class
$dirtyIndex
$factories
$fragment
$id
$index
$label
$order
$pages
$parent
$permission
$privilege
$properties
$rel
$resource
$rev
$target
$textDomain
$title
$visible
Base class for Zend\Navigation\Page pages
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');
inherited_from | \Zend\Navigation\AbstractContainer::__call() |
---|
string
method name
array
method arguments
\Zend\Navigation\Exception\BadMethodCallException |
if method does not exist |
---|
__construct(array | \Traversable $options)
array\Traversable
[optional] page options. Default is null, which should set defaults.
\Zend\Navigation\Exception\InvalidArgumentException |
if invalid options are given |
---|
__get(string $name) : mixed
Magic overload for enabling
$page->propname
.
string
property name
\Zend\Navigation\Exception\InvalidArgumentException |
if property name is invalid |
---|
mixed
property value or null__isset(string $name) : bool
Magic overload for enabling
isset($page->propname)
.
Returns true if the property is native (id, class, title, etc), and true or false if it's a custom property (depending on whether the property actually is set).
string
property name
bool
whether the given property exists__set(string $name, mixed $value) : void
Magic overload for enabling
$page->propname = $value
.
string
property name
mixed
value to set
\Zend\Navigation\Exception\InvalidArgumentException |
if property name is invalid |
---|
__toString() : string
Magic overload for enabling
echo $page
.
string
page label__unset(string $name) : void
Magic overload for enabling
unset($page->propname)
.
string
property name
\Zend\Navigation\Exception\InvalidArgumentException |
if the property is native |
---|
addFactory(\Zend\Navigation\Page\callable $callback)
\Zend\Navigation\Page\callable
Any callable variable
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().
inherited_from | \Zend\Navigation\AbstractContainer::addPage() |
---|
\Zend\Navigation\Exception\InvalidArgumentException |
if page is invalid |
---|
\Zend\Navigation\self
fluent interface, returns selfaddPages(array | \Traversable | \Zend\Navigation\AbstractContainer $pages) : \Zend\Navigation\self
inherited_from | \Zend\Navigation\AbstractContainer::addPages() |
---|
\Zend\Navigation\Exception\InvalidArgumentException |
if $pages is not array, Traversable or AbstractContainer |
---|
\Zend\Navigation\self
fluent interface, returns selfaddRel(string $relation, mixed $value) : \Zend\Navigation\Page\AbstractPage
string
relation name (e.g. alternate, glossary, canonical, etc)
mixed
value to set for relation
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfaddRev(string $relation, mixed $value) : \Zend\Navigation\Page\AbstractPage
string
relation name (e.g. alternate, glossary, canonical, etc)
mixed
value to set for relation
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfcount() : int
Implements Countable interface.
inherited_from | \Zend\Navigation\AbstractContainer::count() |
---|
int
number of pages in the containercurrent() : \Zend\Navigation\Page\AbstractPage
Implements RecursiveIterator interface.
inherited_from | \Zend\Navigation\AbstractContainer::current() |
---|
\Zend\Navigation\Exception\OutOfBoundsException |
if the index is invalid |
---|
\Zend\Navigation\Page\AbstractPage
current page or nullfactory(array | \Traversable $options) : \Zend\Navigation\Page\AbstractPage
A specific type to construct can be specified by specifying the key 'type' in $options. If type is 'uri' or 'mvc', the type will be resolved to Zend\Navigation\Page\Uri or Zend\Navigation\Page\Mvc. Any other value for 'type' will be considered the full name of the class to construct. A valid custom page class must extend Zend\Navigation\Page\AbstractPage.
If 'type' is not given, the type of page to construct will be determined by the following rules: - If $options contains either of the keys 'action', 'controller', or 'route', a Zend\Navigation\Page\Mvc page will be created. - If $options contains the key 'uri', a Zend\Navigation\Page\Uri page will be created.
array\Traversable
options used for creating page
\Zend\Navigation\Exception\InvalidArgumentException |
if $options is not array/Traversable |
---|---|
\Zend\Navigation\Exception\InvalidArgumentException |
if 'type' is specified but class not found |
\Zend\Navigation\Exception\InvalidArgumentException |
if something goes wrong during instantiation of the page |
\Zend\Navigation\Exception\InvalidArgumentException |
if 'type' is given, and the specified type does not extend this class |
\Zend\Navigation\Exception\InvalidArgumentException |
if unable to determine which class to instantiate |
\Zend\Navigation\Page\AbstractPage
a page instancefindAllBy(string $property, mixed $value) : array
inherited_from | \Zend\Navigation\AbstractContainer::findAllBy() |
---|
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
inherited_from | \Zend\Navigation\AbstractContainer::findBy() |
---|
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
inherited_from | \Zend\Navigation\AbstractContainer::findOneBy() |
---|
string
name of property to match against
mixed
value to match property against
\Zend\Navigation\Page\AbstractPage
null
matching page or nullget(string $property) : mixed
If the given property is native (id, class, title, etc), the matching get method will be used. Otherwise, it will return the matching custom property, or null if not found.
string
property name
\Zend\Navigation\Exception\InvalidArgumentException |
if property name is invalid |
---|
mixed
the property's value or nullgetActive(bool $recursive) : bool
bool
[optional] whether page should be considered active if any child pages are active. Default is false.
bool
whether page should be considered activegetChildren() : \Zend\Navigation\Page\AbstractPage | null
Implements RecursiveIterator interface.
inherited_from | \Zend\Navigation\AbstractContainer::getChildren() |
---|
getClass() : string | null
string
null
page's CSS class or nullgetCustomProperties() : array
array
an array containing custom propertiesgetDefinedRel() : array
array
defined forward relationsgetDefinedRev() : array
array
defined reverse relationsgetFragment() : string | null
string
null
fragment identifiergetHref() : string
string
the page's hrefgetId() : string | null
string
null
page id or nullgetLabel() : string
string
page label or nullgetOrder() : int | null
int
null
page order or nullgetPages() : array
inherited_from | \Zend\Navigation\AbstractContainer::getPages() |
---|
array
array of Page\AbstractPage instancesgetParent() : \Zend\Navigation\AbstractContainer | null
\Zend\Navigation\AbstractContainer
null
parent container or nullgetPermission() : mixed | null
mixed
null
permission or nullgetPrivilege() : string | null
string
null
ACL privilege or nullgetRel(string $relation) : array
This method returns an associative array of forward links to other pages, where each element's key is the name of the relation (e.g. alternate, prev, next, help, etc), and the value is a mixed value that could somehow be considered a page.
string
[optional] name of relation to return. If not given, all relations will be returned.
array
an array of relations. If $relation is not specified, all relations will be returned in an associative array.getResource() : string | \Zend\Permissions\Acl\Resource\ResourceInterface | null
getRev(string $relation) : array
This method returns an associative array of forward links to other pages, where each element's key is the name of the relation (e.g. alternate, prev, next, help, etc), and the value is a mixed value that could somehow be considered a page.
string
[optional] name of relation to return. If not given, all relations will be returned.
array
an array of relations. If $relation is not specified, all relations will be returned in an associative array.getTarget() : string | null
string
null
page target or nullgetTextDomain() : mixed | null
mixed
null
text domain or nullgetTitle() : string | null
string
null
page title or nullgetVisible(bool $recursive) : bool
Returns a boolean value indicating whether the page is visible
bool
[optional] whether page should be considered invisible if parent is invisible. Default is false.
bool
whether page should be considered visiblehasChildren() : bool
Implements RecursiveIterator interface.
inherited_from | \Zend\Navigation\AbstractContainer::hasChildren() |
---|
bool
whether container has any pageshasPage(\Zend\Navigation\Page\AbstractPage $page, bool $recursive) : bool
inherited_from | \Zend\Navigation\AbstractContainer::hasPage() |
---|
bool
[optional] whether to search recursively. Default is false.
bool
whether page is in containerhasPages(bool $onlyVisible) : bool
inherited_from | \Zend\Navigation\AbstractContainer::hasPages() |
---|
bool
whether to check only visible pages
bool
whether container has any pageshashCode() : string
string
a hash code value for this pageisActive(bool $recursive) : bool
bool
[optional] whether page should be considered active if any child pages are active. Default is false.
bool
whether page should be considered activeisVisible(bool $recursive) : bool
bool
[optional] whether page should be considered invisible if parent is invisible. Default is false.
bool
whether page should be considered visiblekey() : string
Implements RecursiveIterator interface.
inherited_from | \Zend\Navigation\AbstractContainer::key() |
---|
string
hash code of current pagenext() : void
Implements RecursiveIterator interface.
inherited_from | \Zend\Navigation\AbstractContainer::next() |
---|
notifyOrderUpdated() : void
inherited_from | \Zend\Navigation\AbstractContainer::notifyOrderUpdated() |
---|
removePage(\Zend\Navigation\Page\AbstractPage | int $page, bool $recursive) : bool
inherited_from | \Zend\Navigation\AbstractContainer::removePage() |
---|
\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
inherited_from | \Zend\Navigation\AbstractContainer::removePages() |
---|
\Zend\Navigation\self
fluent interface, returns selfremoveRel(string $relation) : \Zend\Navigation\Page\AbstractPage
string
name of relation to remove
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfremoveRev(string $relation) : \Zend\Navigation\Page\AbstractPage
string
name of relation to remove
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfrewind() : void
Implements RecursiveIterator interface.
inherited_from | \Zend\Navigation\AbstractContainer::rewind() |
---|
set(string $property, mixed $value) : \Zend\Navigation\Page\AbstractPage
If the given property is native (id, class, title, etc), the matching set method will be used. Otherwise, it will be set as a custom property.
string
property name
mixed
value to set
\Zend\Navigation\Exception\InvalidArgumentException |
if property name is invalid |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetActive(bool $active) : \Zend\Navigation\Page\AbstractPage
bool
[optional] whether page should be considered active or not. Default is true.
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetClass(string | null $class) : \Zend\Navigation\Page\AbstractPage
stringnull
[optional] CSS class to set. Default is null, which sets no CSS class.
\Zend\Navigation\Exception\InvalidArgumentException |
if not given string or null |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetFragment(string $fragment) : \Zend\Navigation\Page\AbstractPage
string
new fragment identifier
\Zend\Navigation\Exception\InvalidArgumentException |
if empty/no string is given |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetId(string | null $id) : \Zend\Navigation\Page\AbstractPage
stringnull
[optional] id to set. Default is null, which sets no id.
\Zend\Navigation\Exception\InvalidArgumentException |
if not given string or null |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetLabel(string $label) : \Zend\Navigation\Page\AbstractPage
string
new page label
\Zend\Navigation\Exception\InvalidArgumentException |
if empty/no string is given |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetOptions(array $options) : \Zend\Navigation\Page\AbstractPage
Each key in the array corresponds to the according set*() method, and each word is separated by underscores, e.g. the option 'target' corresponds to setTarget(), and the option 'reset_params' corresponds to the method setResetParams().
array
associative array of options to set
\Zend\Navigation\Exception\InvalidArgumentException |
if invalid options are given |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetOrder(int $order) : \Zend\Navigation\Page\AbstractPage
int
[optional] page order in container. Default is null, which sets no specific order.
\Zend\Navigation\Exception\InvalidArgumentException |
if order is not integer or null |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetPages(array $pages) : \Zend\Navigation\self
inherited_from | \Zend\Navigation\AbstractContainer::setPages() |
---|
array
pages to set
\Zend\Navigation\self
fluent interface, returns selfsetParent(\Zend\Navigation\AbstractContainer $parent) : \Zend\Navigation\Page\AbstractPage
\Zend\Navigation\AbstractContainer
[optional] new parent to set. Default is null which will set no parent.
\Zend\Navigation\Exception\InvalidArgumentException |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetPermission(mixed | null $permission) : \Zend\Navigation\Page\AbstractPage
mixednull
[optional] permission to associate with this page. Default is null, which sets no permission.
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetPrivilege(string | null $privilege) : \Zend\Navigation\Page\AbstractPage
stringnull
[optional] ACL privilege to associate with this page. Default is null, which sets no privilege.
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetRel(array | \Traversable $relations) : \Zend\Navigation\Page\AbstractPage
This method expects an associative array of forward links to other pages, where each element's key is the name of the relation (e.g. alternate, prev, next, help, etc), and the value is a mixed value that could somehow be considered a page.
array\Traversable
[optional] an associative array of forward links to other pages
\Zend\Navigation\Exception\InvalidArgumentException |
if $relations is not an array or Traversable object |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetResource(string | \Zend\Permissions\Acl\Resource\ResourceInterface $resource) : \Zend\Navigation\Page\AbstractPage
string\Zend\Permissions\Acl\Resource\ResourceInterface
[optional] resource to associate with page. Default is null, which sets no resource.
\Zend\Navigation\Exception\InvalidArgumentException |
if $resource is invalid |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetRev(array | \Traversable $relations) : \Zend\Navigation\Page\AbstractPage
This method expects an associative array of reverse links to other pages, where each element's key is the name of the relation (e.g. alternate, prev, next, help, etc), and the value is a mixed value that could somehow be considered a page.
array\Traversable
[optional] an associative array of reverse links to other pages
\Zend\Navigation\Exception\InvalidArgumentException |
if $relations it not an array or Traversable object |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetTarget(string | null $target) : \Zend\Navigation\Page\AbstractPage
stringnull
[optional] target to set. Default is null, which sets no target.
\Zend\Navigation\Exception\InvalidArgumentException |
if target is not string or null |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetTextDomain(string | null $textDomain) : \Zend\Navigation\Page\AbstractPage
stringnull
[optional] text domain to associate with this page. Default is null, which sets no text domain.
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetTitle(string $title) : \Zend\Navigation\Page\AbstractPage
string
[optional] page title. Default is null, which sets no title.
\Zend\Navigation\Exception\InvalidArgumentException |
if not given string or null |
---|
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selfsetVisible(bool $visible) : \Zend\Navigation\Page\AbstractPage
bool
[optional] whether page should be considered visible or not. Default is true.
\Zend\Navigation\Page\AbstractPage
fluent interface, returns selftoArray() : array
array
associative array containing all page propertiesvalid() : bool
Implements RecursiveIterator interface.
inherited_from | \Zend\Navigation\AbstractContainer::valid() |
---|
bool
init() : void
normalizePropertyName(string $property) : string
string
property name to normalize
string
normalized property namesort() : void
inherited_from | \Zend\Navigation\AbstractContainer::sort() |
---|
$active : bool
$class : string | null
$dirtyIndex : bool
inherited_from | \Zend\Navigation\AbstractContainer::$$dirtyIndex |
---|
$factories : array
$fragment : string | null
The fragment identifier (anchor identifier) pointing to an anchor within a resource that is subordinate to another, primary resource. The fragment identifier introduced by a hash mark "#". Example: http://www.example.org/foo.html#bar ("bar" is the fragment identifier)
link | http://www.w3.org/TR/html401/intro/intro.html#fragment-uri |
---|
$id : string | null
$index : array
inherited_from | \Zend\Navigation\AbstractContainer::$$index |
---|
$label : string | null
$order : int | null
$pages : array
inherited_from | \Zend\Navigation\AbstractContainer::$$pages |
---|
$privilege : string | null
$properties : array
$rel : array
$resource : string | \Zend\Permissions\Acl\Resource\ResourceInterface | null
$rev : array
$target : string | null
$textDomain : string
$title : string | null
$visible : bool