Abstract Class Zend_Navigation_Page

Description

Base class for Zend_Navigation_Page pages

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /Navigation/Page.php (line 35)

Zend_Navigation_Container
   |
   --Zend_Navigation_Page
Direct descendents
Class Description
 class Zend_Navigation_Page_Uri Represents a page that is defined by specifying a URI
 class Zend_Navigation_Page_Mvc Represents a page that is defined using module, controller, action, route name and route params to assemble the href
Variable Summary
 bool $_active
 string|null $_class
 string|null $_id
 string|null $_label
 int|null $_order
 string|null $_privilege
 array $_properties
 array $_rel
 array $_rev
 string|null $_target
 string|null $_title
 bool $_visible
Method Summary
 static Zend_Navigation_Page factory (array|Zend_Config $options)
 static string _normalizePropertyName (string $property)
 Zend_Navigation_Page __construct ([array|Zend_Config $options = null])
 Zend_Navigation_Page addRel (string $relation, mixed $value)
 Zend_Navigation_Page addRev (string $relation, mixed $value)
 mixed get (string $property)
 bool getActive ([bool $recursive = false])
 string|null getClass ()
 array getDefinedRel ()
 array getDefinedRev ()
 string getHref ()
 string|null getId ()
 string getLabel ()
 int|null getOrder ()
 string|null getPrivilege ()
 array getRel ([string $relation = null])
 array getRev ([string $relation = null])
 string|null getTarget ()
 string|null getTitle ()
 bool getVisible ([bool $recursive = false])
 string hashCode ()
 bool isActive ([bool $recursive = false])
 bool isVisible ([bool $recursive = false])
 Zend_Navigation_Page removeRel (string $relation)
 Zend_Navigation_Page removeRev (string $relation)
 Zend_Navigation_Page set (string $property, mixed $value)
 Zend_Navigation_Page setActive ([bool $active = true])
 Zend_Navigation_Page setClass ([string|null $class = null])
 Zend_Navigation_Page setId ([string|null $id = null])
 Zend_Navigation_Page setLabel (string $label)
 Zend_Navigation_Page setOrder ([int $order = null])
 Zend_Navigation_Page setPrivilege ([string|null $privilege = null])
 Zend_Navigation_Page setRel ([array|Zend_Config $relations = null])
 Zend_Navigation_Page setRev ([array|Zend_Config $relations = null])
 Zend_Navigation_Page setTarget ([string|null $target = null])
 Zend_Navigation_Page setTitle ([string $title = null])
 Zend_Navigation_Page setVisible ([bool $visible = true])
 array toArray ()
 void _init ()
 mixed __get (string $name)
 bool __isset (string $name)
 void __set (string $name, mixed $value)
 string __toString ()
 void __unset (string $name)
Variables
bool $_active = false (line 116)

Whether this page should be considered active

  • access: protected
string|null $_class (line 56)

Style class for this page (CSS)

  • access: protected
string|null $_id (line 49)

Page id

  • access: protected
string|null $_label (line 42)

Page label

  • access: protected
int|null $_order (line 95)

Page order used by parent container

  • access: protected
Zend_Navigation_Container|null $_parent (line 130)

Parent container

  • access: protected
string|null $_privilege (line 109)

ACL privilege associated with this page

  • access: protected
array $_properties = array() (line 137)

Custom page properties, used by __set(), __get() and __isset()

  • access: protected
array $_rel = array() (line 79)

Forward links to other pages

string|Zend_Acl_Resource_Interface|null $_resource (line 102)

ACL resource associated with this page

  • access: protected
array $_rev = array() (line 88)

Reverse links to other pages

string|null $_target (line 70)

This page's target

  • access: protected
string|null $_title (line 63)

A more descriptive title for this page

  • access: protected
bool $_visible = true (line 123)

Whether this page should be considered visible

  • access: protected

Inherited Variables

Inherited from Zend_Navigation_Container

Zend_Navigation_Container::$_dirtyIndex
Zend_Navigation_Container::$_index
Zend_Navigation_Container::$_pages
Methods
static factory (line 170)

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', 'module', 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.

  • return: a page instance
  • throws: Zend_Navigation_Exception if $options is not array/Zend_Config
  • throws: Zend_Navigation_Exception if unable to determine which class to instantiate
  • throws: Zend_Exception if 'type' is specified and Zend_Loader is unable to load the class
  • throws: Zend_Navigation_Exception if something goes wrong during instantiation of the page
  • throws: Zend_Navigation_Exception if 'type' is given, and the specified type does not extend this class
  • access: public
static Zend_Navigation_Page factory (array|Zend_Config $options)
  • array|Zend_Config $options: options used for creating page
static _normalizePropertyName (line 1106)

Normalizes a property name

  • return: normalized property name
  • access: protected
static string _normalizePropertyName (string $property)
  • string $property: property name to normalize
Constructor __construct (line 235)

Page constructor

  • throws: Zend_Navigation_Exception if invalid options are given
  • access: public
Zend_Navigation_Page __construct ([array|Zend_Config $options = null])
  • array|Zend_Config $options: [optional] page options. Default is null, which should set defaults.
addRel (line 977)

Adds a forward relation to the page

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page addRel (string $relation, mixed $value)
  • string $relation: relation name (e.g. alternate, glossary, canonical, etc)
  • mixed $value: value to set for relation
addRev (line 993)

Adds a reverse relation to the page

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page addRev (string $relation, mixed $value)
  • string $relation: relation name (e.g. alternate, glossary, canonical, etc)
  • mixed $value: value to set for relation
get (line 859)

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.

  • return: the property's value or null
  • throws: Zend_Navigation_Exception if property name is invalid
  • access: public
mixed get (string $property)
  • string $property: property name
getActive (line 717)

Proxy to isActive()

  • return: whether page should be considered active
  • access: public
bool getActive ([bool $recursive = false])
  • bool $recursive: [optional] whether page should be considered active if any child pages are active. Default is false.
getClass (line 376)

Returns page class (CSS)

  • return: page's CSS class or null
  • access: public
string|null getClass ()
getCustomProperties (line 1056)

Returns custom properties as an array

  • return: an array containing custom properties
  • access: public
array getCustomProperties ()
getDefinedRel (line 1036)

Returns an array containing the defined forward relations

  • return: defined forward relations
  • access: public
array getDefinedRel ()
getDefinedRev (line 1046)

Returns an array containing the defined reverse relations

  • return: defined reverse relations
  • access: public
array getDefinedRev ()
getHref (line 1118)

Returns href for this page

  • return: the page's href
  • abstract:
  • access: public
string getHref ()

Redefined in descendants as:
getId (line 346)

Returns page id

  • return: page id or null
  • access: public
string|null getId ()
getLabel (line 315)

Returns page label

  • return: page label or null
  • access: public
string getLabel ()
getOrder (line 607)

Returns page order used in parent container

  • return: page order or null
  • access: public
int|null getOrder ()
getParent (line 812)

Returns parent container

  • return: parent container or null
  • access: public
Zend_Navigation_Container|null getParent ()
getPrivilege (line 669)

Returns ACL privilege associated with this page

  • return: ACL privilege or null
  • access: public
string|null getPrivilege ()
getRel (line 493)

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.

  • return: an array of relations. If $relation is not specified, all relations will be returned in an associative array.
  • access: public
array getRel ([string $relation = null])
  • string $relation: [optional] name of relation to return. If not given, all relations will be returned.
getResource (line 645)

Returns ACL resource assoicated with this page

  • return: ACL resource or null
  • access: public
string|Zend_Acl_Resource_Interface|null getResource ()
getRev (line 556)

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.

  • return: an array of relations. If $relation is not specified, all relations will be returned in an associative array.
  • access: public
array getRev ([string $relation = null])
  • string $relation: [optional] name of relation to return. If not given, all relations will be returned.
getTarget (line 436)

Returns page target

  • return: page target or null
  • access: public
string|null getTarget ()
getTitle (line 406)

Returns page title

  • return: page title or null
  • access: public
string|null getTitle ()
getVisible (line 765)

Proxy to isVisible()

Returns a boolean value indicating whether the page is visible

  • return: whether page should be considered visible
  • access: public
bool getVisible ([bool $recursive = false])
  • bool $recursive: [optional] whether page should be considered invisible if parent is invisible. Default is false.
hashCode (line 1066)

Returns a hash code value for the page

  • return: a hash code value for this page
  • access: public
string hashCode ()
isActive (line 695)

Returns whether page should be considered active or not

  • return: whether page should be considered active
  • access: public
bool isActive ([bool $recursive = false])
  • bool $recursive: [optional] whether page should be considered active if any child pages are active. Default is false.

Redefined in descendants as:
isVisible (line 743)

Returns a boolean value indicating whether the page is visible

  • return: whether page should be considered visible
  • access: public
bool isVisible ([bool $recursive = false])
  • bool $recursive: [optional] whether page should be considered invisible if parent is invisible. Default is false.
removeRel (line 1007)

Removes a forward relation from the page

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page removeRel (string $relation)
  • string $relation: name of relation to remove
removeRev (line 1022)

Removes a reverse relation from the page

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page removeRev (string $relation)
  • string $relation: name of relation to remove
set (line 828)

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.

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if property name is invalid
  • access: public
Zend_Navigation_Page set (string $property, mixed $value)
  • string $property: property name
  • mixed $value: value to set
setActive (line 681)

Sets whether page should be considered active or not

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page setActive ([bool $active = true])
  • bool $active: [optional] whether page should be considered active or not. Default is true.
setClass (line 359)

Sets page CSS class

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if not given string or null
  • access: public
Zend_Navigation_Page setClass ([string|null $class = null])
  • string|null $class: [optional] CSS class to set. Default is null, which sets no CSS class.
setConfig (line 263)

Sets page properties using a Zend_Config object

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if invalid options are given
  • access: public
Zend_Navigation_Page setConfig ( $config)
  • Zend_Config $config: config object to get properties from
setId (line 328)

Sets page id

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if not given string or null
  • access: public
Zend_Navigation_Page setId ([string|null $id = null])
  • string|null $id: [optional] id to set. Default is null, which sets no id.
setLabel (line 298)

Sets page label

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if empty/no string is given
  • access: public
Zend_Navigation_Page setLabel (string $label)
  • string $label: new page label
setOptions (line 280)

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

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if invalid options are given
  • access: public
Zend_Navigation_Page setOptions ( $options)
  • array $options: associative array of options to set
setOrder (line 576)

Sets page order to use in parent container

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if order is not integer or null
  • access: public
Zend_Navigation_Page setOrder ([int $order = null])
  • int $order: [optional] page order in container. Default is null, which sets no specific order.
setParent (line 778)

Sets parent container

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page setParent ([Zend_Navigation_Container $parent = null])
setPrivilege (line 658)

Sets ACL privilege associated with this page

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page setPrivilege ([string|null $privilege = null])
  • string|null $privilege: [optional] ACL privilege to associate with this page. Default is null, which sets no privilege.
setRel (line 453)

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.

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page setRel ([array|Zend_Config $relations = null])
  • array|Zend_Config $relations: [optional] an associative array of forward links to other pages
setResource (line 625)

Sets ACL resource assoicated with this page

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if $resource if invalid
  • access: public
Zend_Navigation_Page setResource ([string|Zend_Acl_Resource_Interface $resource = null])
setRev (line 516)

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.

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page setRev ([array|Zend_Config $relations = null])
  • array|Zend_Config $relations: [optional] an associative array of reverse links to other pages
setTarget (line 419)

Sets page target

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if target is not string or null
  • access: public
Zend_Navigation_Page setTarget ([string|null $target = null])
  • string|null $target: [optional] target to set. Default is null, which sets no target.
setTitle (line 389)

Sets page title

  • return: fluent interface, returns self
  • throws: Zend_Navigation_Exception if not given string or null
  • access: public
Zend_Navigation_Page setTitle ([string $title = null])
  • string $title: [optional] page title. Default is null, which sets no title.
setVisible (line 729)

Sets whether the page should be visible or not

  • return: fluent interface, returns self
  • access: public
Zend_Navigation_Page setVisible ([bool $visible = true])
  • bool $visible: [optional] whether page should be considered visible or not. Default is true.
toArray (line 1076)

Returns an array representation of the page

  • return: associative array containing all page properties
  • access: public
array toArray ()

Redefinition of:
Zend_Navigation_Container::toArray()
Returns an array representation of all pages in container

Redefined in descendants as:
_init (line 252)

Initializes page (used by subclasses)

  • access: protected
void _init ()
__get (line 904)

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

Magic overload for enabling

  1. $page->propname
.

  • return: property value or null
  • throws: Zend_Navigation_Exception if property name is invalid
  • access: public
mixed __get (string $name)
  • string $name: property name
__isset (line 921)

Checks if a property is set

Magic overload for enabling

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

  • return: whether the given property exists
  • access: public
bool __isset (string $name)
  • string $name: property name
__set (line 890)

Sets a custom property

Magic overload for enabling

  1. $page->propname $value
.

  • throws: Zend_Navigation_Exception if property name is invalid
  • access: public
void __set (string $name, mixed $value)
  • string $name: property name
  • mixed $value: value to set
__toString (line 962)

Returns page label

Magic overload for enabling

  1. echo $page
.

  • return: page label
  • access: public
string __toString ()
__unset (line 940)

Unsets the given custom property

Magic overload for enabling

  1. unset($page->propname)
.

  • throws: Zend_Navigation_Exception if the property is native
  • access: public
void __unset (string $name)
  • string $name: property name

Inherited Methods

Inherited From Zend_Navigation_Container

 Zend_Navigation_Container::addPage()
 Zend_Navigation_Container::addPages()
 Zend_Navigation_Container::count()
 Zend_Navigation_Container::current()
 Zend_Navigation_Container::findAllBy()
 Zend_Navigation_Container::findBy()
 Zend_Navigation_Container::findOneBy()
 Zend_Navigation_Container::getChildren()
 Zend_Navigation_Container::getPages()
 Zend_Navigation_Container::hasChildren()
 Zend_Navigation_Container::hasPage()
 Zend_Navigation_Container::hasPages()
 Zend_Navigation_Container::key()
 Zend_Navigation_Container::next()
 Zend_Navigation_Container::notifyOrderUpdated()
 Zend_Navigation_Container::removePage()
 Zend_Navigation_Container::removePages()
 Zend_Navigation_Container::rewind()
 Zend_Navigation_Container::setPages()
 Zend_Navigation_Container::toArray()
 Zend_Navigation_Container::valid()
 Zend_Navigation_Container::_sort()
 Zend_Navigation_Container::__call()

Documentation generated on Mon, 21 Jun 2010 15:37:10 -0400 by phpDocumentor 1.4.3