1353. Class

1353.1. Zend\Navigation\Page\AbstractPage

Base class for ZendNavigationPage pages

1353.1.1. Methods

1353.1.1.1. factory

factory()

Factory for Zend_Navigation_Page classes

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.

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.
Parameters:array|Traversable – options used for creating page
Return type:AbstractPage a page instance
Throws :ExceptionInvalidArgumentException if $options is not array/Traversable
Throws :ExceptionInvalidArgumentException if ‘type’ is specified but class not found
Throws :ExceptionInvalidArgumentException if something goes wrong during instantiation of the page
Throws :ExceptionInvalidArgumentException if ‘type’ is given, and the specified type does not extend this class
Throws :ExceptionInvalidArgumentException if unable to determine which class to instantiate

1353.1.1.2. __construct

__construct()

Page constructor

Parameters:array|Traversable – [optional] page options. Default is null, which should set defaults.
Throws ExceptionInvalidArgumentException:
 if invalid options are given

1353.1.1.3. init

init()

Initializes page (used by subclasses)

Return type:void

1353.1.1.4. setOptions

setOptions()

Sets page properties using options from an associative array

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().

Parameters:array – associative array of options to set
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if invalid options are given

1353.1.1.5. setLabel

setLabel()

Sets page label

Parameters:string – new page label
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if empty/no string is given

1353.1.1.6. getLabel

getLabel()

Returns page label

Return type:string page label or null

1353.1.1.7. setFragment

setFragment()

Sets a fragment identifier

Parameters:string – new fragment identifier
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if empty/no string is given

1353.1.1.8. getFragment

getFragment()

Returns fragment identifier

Return type:string|null fragment identifier

1353.1.1.9. setId

setId()

Sets page id

Parameters:string|null – [optional] id to set. Default is null, which sets no id.
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if not given string or null

1353.1.1.10. getId

getId()

Returns page id

Return type:string|null page id or null

1353.1.1.11. setClass

setClass()

Sets page CSS class

Parameters:string|null – [optional] CSS class to set. Default is null, which sets no CSS class.
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if not given string or null

1353.1.1.12. getClass

getClass()

Returns page class (CSS)

Return type:string|null page’s CSS class or null

1353.1.1.13. setTitle

setTitle()

Sets page title

Parameters:string – [optional] page title. Default is null, which sets no title.
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if not given string or null

1353.1.1.14. getTitle

getTitle()

Returns page title

Return type:string|null page title or null

1353.1.1.15. setTarget

setTarget()

Sets page target

Parameters:string|null – [optional] target to set. Default is null, which sets no target.
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if target is not string or null

1353.1.1.16. getTarget

getTarget()

Returns page target

Return type:string|null page target or null

1353.1.1.17. setRel

setRel()

Sets the page’s forward links to other pages

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.

Parameters:array|Traversable – [optional] an associative array of forward links to other pages
Throws ExceptionInvalidArgumentException:
 if $relations is not an array or Traversable object
Return type:AbstractPage fluent interface, returns self

1353.1.1.18. getRel

getRel()

Returns the page’s forward links to other pages

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.

Parameters:string – [optional] name of relation to return. If not given, all relations will be returned.
Return type:array an array of relations. If $relation is not specified, all relations will be returned in an associative array.

1353.1.1.19. setRev

setRev()

Sets the page’s reverse links to other pages

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.

Parameters:array|Traversable – [optional] an associative array of reverse links to other pages
Throws ExceptionInvalidArgumentException:
 if $relations it not an array or Traversable object
Return type:AbstractPage fluent interface, returns self

1353.1.1.20. getRev

getRev()

Returns the page’s reverse links to other pages

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.

Parameters:string – [optional] name of relation to return. If not given, all relations will be returned.
Return type:array an array of relations. If $relation is not specified, all relations will be returned in an associative array.

1353.1.1.21. setOrder

setOrder()

Sets page order to use in parent container

Parameters:int – [optional] page order in container. Default is null, which sets no specific order.
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if order is not integer or null

1353.1.1.22. getOrder

getOrder()

Returns page order used in parent container

Return type:int|null page order or null

1353.1.1.23. setResource

setResource()

Sets ACL resource associated with this page

Parameters:string|AclResource – [optional] resource to associate with page. Default is null, which sets no resource.
Return type:AbstractPage fluent interface, returns self
Throws :ExceptionInvalidArgumentException if $resource is invalid

1353.1.1.24. getResource

getResource()

Returns ACL resource associated with this page

Return type:string|AclResource|null ACL resource or null

1353.1.1.25. setPrivilege

setPrivilege()

Sets ACL privilege associated with this page

Parameters:string|null – [optional] ACL privilege to associate with this page. Default is null, which sets no privilege.
Return type:AbstractPage fluent interface, returns self

1353.1.1.26. getPrivilege

getPrivilege()

Returns ACL privilege associated with this page

Return type:string|null ACL privilege or null

1353.1.1.27. setActive

setActive()

Sets whether page should be considered active or not

Parameters:bool – [optional] whether page should be considered active or not. Default is true.
Return type:AbstractPage fluent interface, returns self

1353.1.1.28. isActive

isActive()

Returns whether page should be considered active or not

Parameters:bool – [optional] whether page should be considered active if any child pages are active. Default is false.
Return type:bool whether page should be considered active

1353.1.1.29. getActive

getActive()

Proxy to isActive()

Parameters:bool – [optional] whether page should be considered active if any child pages are active. Default is false.
Return type:bool whether page should be considered active

1353.1.1.30. setVisible

setVisible()

Sets whether the page should be visible or not

Parameters:bool – [optional] whether page should be considered visible or not. Default is true.
Return type:AbstractPage fluent interface, returns self

1353.1.1.31. isVisible

isVisible()

Returns a boolean value indicating whether the page is visible

Parameters:bool – [optional] whether page should be considered invisible if parent is invisible. Default is false.
Return type:bool whether page should be considered visible

1353.1.1.32. getVisible

getVisible()

Proxy to isVisible()

Returns a boolean value indicating whether the page is visible

Parameters:bool – [optional] whether page should be considered invisible if parent is invisible. Default is false.
Return type:bool whether page should be considered visible

1353.1.1.33. setParent

setParent()

Sets parent container

Parameters:AbstractContainer – [optional] new parent to set. Default is null which will set no parent.
Throws ExceptionInvalidArgumentException:
 
Return type:AbstractPage fluent interface, returns self

1353.1.1.34. getParent

getParent()

Returns parent container

Return type:AbstractContainer|null parent container or null

1353.1.1.35. set

set()

Sets the given property

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.

Parameters:
  • string – property name
  • mixed – value to set
Return type:

AbstractPage fluent interface, returns self

Throws :

ExceptionInvalidArgumentException if property name is invalid

1353.1.1.36. get

get()

Returns the value of the given property

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.

Parameters:string – property name
Return type:mixed the property’s value or null
Throws :ExceptionInvalidArgumentException if property name is invalid

1353.1.1.37. __set

__set()

Sets a custom property

Magic overload for enabling <code>$page->propname = $value</code>.

Parameters:
  • string – property name
  • mixed – value to set
Return type:

void

Throws :

ExceptionInvalidArgumentException if property name is invalid

1353.1.1.38. __get

__get()

Returns a property, or null if it doesn’t exist

Magic overload for enabling <code>$page->propname</code>.

Parameters:string – property name
Return type:mixed property value or null
Throws :ExceptionInvalidArgumentException if property name is invalid

1353.1.1.39. __isset

__isset()

Checks if a property is set

Magic overload for enabling <code>isset($page->propname)</code>.

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).

Parameters:string – property name
Return type:bool whether the given property exists

1353.1.1.40. __unset

__unset()

Unsets the given custom property

Magic overload for enabling <code>unset($page->propname)</code>.

Parameters:string – property name
Return type:void
Throws :ExceptionInvalidArgumentException if the property is native

1353.1.1.41. __toString

__toString()

Returns page label

Magic overload for enabling <code>echo $page</code>.

Return type:string page label

1353.1.1.42. addRel

addRel()

Adds a forward relation to the page

Parameters:
  • string – relation name (e.g. alternate, glossary, canonical, etc)
  • mixed – value to set for relation
Return type:

AbstractPage fluent interface, returns self

1353.1.1.43. addRev

addRev()

Adds a reverse relation to the page

Parameters:
  • string – relation name (e.g. alternate, glossary, canonical, etc)
  • mixed – value to set for relation
Return type:

AbstractPage fluent interface, returns self

1353.1.1.44. removeRel

removeRel()

Removes a forward relation from the page

Parameters:string – name of relation to remove
Return type:AbstractPage fluent interface, returns self

1353.1.1.45. removeRev

removeRev()

Removes a reverse relation from the page

Parameters:string – name of relation to remove
Return type:AbstractPage fluent interface, returns self

1353.1.1.46. getDefinedRel

getDefinedRel()

Returns an array containing the defined forward relations

Return type:array defined forward relations

1353.1.1.47. getDefinedRev

getDefinedRev()

Returns an array containing the defined reverse relations

Return type:array defined reverse relations

1353.1.1.48. getCustomProperties

getCustomProperties()

Returns custom properties as an array

Return type:array an array containing custom properties

1353.1.1.49. hashCode

hashCode()

Returns a hash code value for the page

Return type:string a hash code value for this page

1353.1.1.50. toArray

toArray()

Returns an array representation of the page

Return type:array associative array containing all page properties

1353.1.1.51. normalizePropertyName

normalizePropertyName()

Normalizes a property name

Parameters:string – property name to normalize
Return type:string normalized property name

1353.1.1.52. getHref

getHref()

Returns href for this page

Return type:string the page’s href

Project Versions

Table Of Contents

Previous topic

1352. Class

Next topic

1354. Class

This Page