Zend Framework
3.0
|
Base class for Zend pages. More...
Public Member Functions | |
__construct ($options=null) | |
Page constructor. | |
setOptions (array $options) | |
Sets page properties using options from an associative array. | |
setLabel ($label) | |
Sets page label. | |
getLabel () | |
Returns page label. | |
setFragment ($fragment) | |
Sets a fragment identifier. | |
getFragment () | |
Returns fragment identifier. | |
setId ($id=null) | |
Sets page id. | |
getId () | |
Returns page id. | |
setClass ($class=null) | |
Sets page CSS class. | |
getClass () | |
Returns page class (CSS) | |
setTitle ($title=null) | |
Sets page title. | |
getTitle () | |
Returns page title. | |
setTarget ($target=null) | |
Sets page target. | |
getTarget () | |
Returns page target. | |
setRel ($relations=null) | |
Sets the page's forward links to other pages. | |
getRel ($relation=null) | |
Returns the page's forward links to other pages. | |
setRev ($relations=null) | |
Sets the page's reverse links to other pages. | |
getRev ($relation=null) | |
Returns the page's reverse links to other pages. | |
setOrder ($order=null) | |
Sets page order to use in parent container. | |
getOrder () | |
Returns page order used in parent container. | |
setResource ($resource=null) | |
Sets ACL resource associated with this page. | |
getResource () | |
Returns ACL resource associated with this page. | |
setPrivilege ($privilege=null) | |
Sets ACL privilege associated with this page. | |
getPrivilege () | |
Returns ACL privilege associated with this page. | |
setPermission ($permission=null) | |
Sets permission associated with this page. | |
getPermission () | |
Returns permission associated with this page. | |
setTextDomain ($textDomain=null) | |
Sets text domain for translation. | |
getTextDomain () | |
Returns text domain for translation. | |
setActive ($active=true) | |
Sets whether page should be considered active or not. | |
isActive ($recursive=false) | |
Returns whether page should be considered active or not. | |
getActive ($recursive=false) | |
Proxy to isActive() | |
setVisible ($visible=true) | |
Sets whether the page should be visible or not. | |
isVisible ($recursive=false) | |
Returns a boolean value indicating whether the page is visible. | |
getVisible ($recursive=false) | |
Proxy to isVisible() | |
setParent (AbstractContainer $parent=null) | |
Sets parent container. | |
getParent () | |
Returns parent container. | |
set ($property, $value) | |
Sets the given property. | |
get ($property) | |
Returns the value of the given property. | |
__set ($name, $value) | |
Sets a custom property. | |
__get ($name) | |
Returns a property, or null if it doesn't exist. | |
__isset ($name) | |
Checks if a property is set. | |
__unset ($name) | |
Unsets the given custom property. | |
__toString () | |
Returns page label. | |
addRel ($relation, $value) | |
Adds a forward relation to the page. | |
addRev ($relation, $value) | |
Adds a reverse relation to the page. | |
removeRel ($relation) | |
Removes a forward relation from the page. | |
removeRev ($relation) | |
Removes a reverse relation from the page. | |
getDefinedRel () | |
Returns an array containing the defined forward relations. | |
getDefinedRev () | |
Returns an array containing the defined reverse relations. | |
getCustomProperties () | |
Returns custom properties as an array. | |
hashCode () | |
Returns a hash code value for the page. | |
toArray () | |
Returns an array representation of the page. | |
getHref () | |
Returns href for this page. | |
Public Member Functions inherited from AbstractContainer | |
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. | |
Static Public Member Functions | |
static | factory ($options) |
Factory for Zend classes. | |
static | addFactory ($callback) |
Add static factory for self::factory function. | |
Protected Member Functions | |
init () | |
Initializes page (used by subclasses) | |
Protected Member Functions inherited from AbstractContainer | |
sort () | |
Sorts the page index according to page order. | |
Static Protected Member Functions | |
static | normalizePropertyName ($property) |
Normalizes a property name. | |
Protected Attributes | |
$label | |
$fragment | |
$id | |
$class | |
$title | |
$target | |
$rel = [] | |
$rev = [] | |
$order | |
$resource | |
$privilege | |
$permission | |
$textDomain | |
$active = false | |
$visible = true | |
$parent | |
$properties = [] | |
Protected Attributes inherited from AbstractContainer | |
$pages = [] | |
$index = [] | |
$dirtyIndex = false | |
Static Protected Attributes | |
static | $factories = [] |
Base class for Zend pages.
__construct | ( | $options = null | ) |
Page constructor.
array | Traversable | $options | [optional] page options. Default is null, which should set defaults. |
Exception\InvalidArgumentException | if invalid options are given |
__get | ( | $name | ) |
Returns a property, or null if it doesn't exist.
Magic overload for enabling $page->propname
.
string | $name | property name |
Exception\InvalidArgumentException | if property name is invalid |
__isset | ( | $name | ) |
Checks if a property is set.
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 | $name | property name |
__set | ( | $name, | |
$value | |||
) |
Sets a custom property.
Magic overload for enabling $page->propname = $value
.
string | $name | property name |
mixed | $value | value to set |
Exception\InvalidArgumentException | if property name is invalid |
__toString | ( | ) |
Returns page label.
Magic overload for enabling echo $page
.
__unset | ( | $name | ) |
Unsets the given custom property.
Magic overload for enabling unset($page->propname)
.
string | $name | property name |
Exception\InvalidArgumentException | if the property is native |
|
static |
Add static factory for self::factory function.
callable | $callback | Any callable variable |
addRel | ( | $relation, | |
$value | |||
) |
Adds a forward relation to the page.
string | $relation | relation name (e.g. alternate, glossary, canonical, etc) |
mixed | $value | value to set for relation |
addRev | ( | $relation, | |
$value | |||
) |
Adds a reverse relation to the page.
string | $relation | relation name (e.g. alternate, glossary, canonical, etc) |
mixed | $value | value to set for relation |
|
static |
Factory for Zend 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 or Zend. Any other value for 'type' will be considered the full name of the class to construct. A valid custom page class must extend Zend.
If 'type' is not given, the type of page to construct will be determined by the following rules:
array | Traversable | $options | options used for creating page |
Exception\InvalidArgumentException | if $options is not array/Traversable |
Exception\InvalidArgumentException | if 'type' is specified but class not found |
Exception\InvalidArgumentException | if something goes wrong during instantiation of the page |
Exception\InvalidArgumentException | if 'type' is given, and the specified type does not extend this class |
Exception\InvalidArgumentException | if unable to determine which class to instantiate |
get | ( | $property | ) |
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.
string | $property | property name |
Exception\InvalidArgumentException | if property name is invalid |
getActive | ( | $recursive = false | ) |
Proxy to isActive()
bool | $recursive | [optional] whether page should be considered active if any child pages are active. Default is false. |
getClass | ( | ) |
Returns page class (CSS)
getCustomProperties | ( | ) |
Returns custom properties as an array.
getDefinedRel | ( | ) |
Returns an array containing the defined forward relations.
getDefinedRev | ( | ) |
Returns an array containing the defined reverse relations.
getFragment | ( | ) |
Returns fragment identifier.
|
abstract |
Returns href for this page.
getId | ( | ) |
Returns page id.
getLabel | ( | ) |
Returns page label.
getOrder | ( | ) |
Returns page order used in parent container.
getParent | ( | ) |
Returns parent container.
getPermission | ( | ) |
Returns permission associated with this page.
getPrivilege | ( | ) |
Returns ACL privilege associated with this page.
getRel | ( | $relation = null | ) |
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.
string | $relation | [optional] name of relation to return. If not given, all relations will be returned. |
getResource | ( | ) |
Returns ACL resource associated with this page.
getRev | ( | $relation = null | ) |
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.
string | $relation | [optional] name of relation to return. If not given, all relations will be returned. |
getTarget | ( | ) |
Returns page target.
getTextDomain | ( | ) |
Returns text domain for translation.
getTitle | ( | ) |
Returns page title.
getVisible | ( | $recursive = false | ) |
Proxy to isVisible()
Returns a boolean value indicating whether the page is visible
bool | $recursive | [optional] whether page should be considered invisible if parent is invisible. Default is false. |
|
final |
Returns a hash code value for the page.
|
protected |
Initializes page (used by subclasses)
isActive | ( | $recursive = false | ) |
Returns whether page should be considered active or not.
bool | $recursive | [optional] whether page should be considered active if any child pages are active. Default is false. |
isVisible | ( | $recursive = false | ) |
Returns a boolean value indicating whether the page is visible.
bool | $recursive | [optional] whether page should be considered invisible if parent is invisible. Default is false. |
|
staticprotected |
Normalizes a property name.
string | $property | property name to normalize |
removeRel | ( | $relation | ) |
Removes a forward relation from the page.
string | $relation | name of relation to remove |
removeRev | ( | $relation | ) |
Removes a reverse relation from the page.
string | $relation | name of relation to remove |
set | ( | $property, | |
$value | |||
) |
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.
string | $property | property name |
mixed | $value | value to set |
Exception\InvalidArgumentException | if property name is invalid |
setActive | ( | $active = true | ) |
Sets whether page should be considered active or not.
bool | $active | [optional] whether page should be considered active or not. Default is true. |
setClass | ( | $class = null | ) |
Sets page CSS class.
string | null | $class | [optional] CSS class to set. Default is null, which sets no CSS class. |
Exception\InvalidArgumentException | if not given string or null |
setFragment | ( | $fragment | ) |
Sets a fragment identifier.
string | $fragment | new fragment identifier |
Exception\InvalidArgumentException | if empty/no string is given |
setId | ( | $id = null | ) |
Sets page id.
string | null | $id | [optional] id to set. Default is null, which sets no id. |
Exception\InvalidArgumentException | if not given string or null |
setLabel | ( | $label | ) |
Sets page label.
string | $label | new page label |
Exception\InvalidArgumentException | if empty/no string is given |
setOptions | ( | array | $options | ) |
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().
array | $options | associative array of options to set |
Exception\InvalidArgumentException | if invalid options are given |
setOrder | ( | $order = null | ) |
Sets page order to use in parent container.
int | $order | [optional] page order in container. Default is null, which sets no specific order. |
Exception\InvalidArgumentException | if order is not integer or null |
setParent | ( | AbstractContainer | $parent = null | ) |
Sets parent container.
AbstractContainer | $parent | [optional] new parent to set. Default is null which will set no parent. |
Exception\InvalidArgumentException |
setPermission | ( | $permission = null | ) |
Sets permission associated with this page.
mixed | null | $permission | [optional] permission to associate with this page. Default is null, which sets no permission. |
setPrivilege | ( | $privilege = null | ) |
Sets ACL privilege associated with this page.
string | null | $privilege | [optional] ACL privilege to associate with this page. Default is null, which sets no privilege. |
setRel | ( | $relations = null | ) |
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.
array | Traversable | $relations | [optional] an associative array of forward links to other pages |
Exception\InvalidArgumentException | if $relations is not an array or Traversable object |
setResource | ( | $resource = null | ) |
Sets ACL resource associated with this page.
string | AclResource | $resource | [optional] resource to associate with page. Default is null, which sets no resource. |
Exception\InvalidArgumentException | if $resource is invalid |
setRev | ( | $relations = null | ) |
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.
array | Traversable | $relations | [optional] an associative array of reverse links to other pages |
Exception\InvalidArgumentException | if $relations it not an array or Traversable object |
setTarget | ( | $target = null | ) |
Sets page target.
string | null | $target | [optional] target to set. Default is null, which sets no target. |
Exception\InvalidArgumentException | if target is not string or null |
setTextDomain | ( | $textDomain = null | ) |
Sets text domain for translation.
string | null | $textDomain | [optional] text domain to associate with this page. Default is null, which sets no text domain. |
setTitle | ( | $title = null | ) |
Sets page title.
string | $title | [optional] page title. Default is null, which sets no title. |
Exception\InvalidArgumentException | if not given string or null |
setVisible | ( | $visible = true | ) |
Sets whether the page should be visible or not.
bool | $visible | [optional] whether page should be considered visible or not. Default is true. |
toArray | ( | ) |
Returns an array representation of the page.
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |