Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_Navigation_Page_Dynamic Class Reference

Provides a facility for dynamic menu entries. More...

List of all members.

Public Member Functions

 getHandler ()
 Returns the id of the dynamic handler associated with this item.
 getHref ()
 Implement getHref as it is abstract in parent.
 getLabel ()
 If we have a handler set, and no label has been set on this page, returns the handlers label.
 setHandler ($id)
 Set the id of the dynamic handler associated with this item.
 toArray ()
 Returns an array representation of the page.

Protected Attributes

 $_handler

Detailed Description

Provides a facility for dynamic menu entries.

Dynamic menu items will be expanded by the associated DynamicHandler when accessed via getExpandedContainer on a Menu instance.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

P4Cms_Navigation_Page_Dynamic::getHandler ( )

Returns the id of the dynamic handler associated with this item.

Returns:
string|null id of the associated dynamic handler or null
    {
        return $this->_handler;
    }
P4Cms_Navigation_Page_Dynamic::getHref ( )

Implement getHref as it is abstract in parent.

We don't actually use it so returns ""

Returns:
string the page's href
    {
        return "";
    }
P4Cms_Navigation_Page_Dynamic::getLabel ( )

If we have a handler set, and no label has been set on this page, returns the handlers label.

Otherwise returns the title as per normal.

Returns:
string|null page title or null
    {
        if ($this->_label || !$this->getHandler()) {
            return $this->_label;
        }

        return P4Cms_Navigation_DynamicHandler::fetch($this->getHandler())->getLabel();
    }
P4Cms_Navigation_Page_Dynamic::setHandler ( id)

Set the id of the dynamic handler associated with this item.

Parameters:
string | null$idid of the associated dynamic handler or null for none
Returns:
P4Cms_Navigation_Page_Dynamic to maintain a fluent interface
    {
        $this->_handler = $id;
        
        return $this;
    }
P4Cms_Navigation_Page_Dynamic::toArray ( )

Returns an array representation of the page.

Returns:
array associative array containing all page properties
    {
        return array_merge(
            parent::toArray(),
            array(
                'handler' => $this->getHandler(),
                'label'   => $this->_label
            )
        );
    }

Member Data Documentation

P4Cms_Navigation_Page_Dynamic::$_handler [protected]

The documentation for this class was generated from the following file: