eZPublishCommunityProject  2013.9
eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter Class Reference

Generic adapter allowing any ValueObject implementation to be LegacyCompatible with the help of a hash map, mapping the legacy attributes name to the value object property name (e.g. More...

+ Inheritance diagram for eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter:
+ Collaboration diagram for eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter:

Public Member Functions

 __construct (ValueObject $valueObject, array $attributesMap)
 
 attribute ($name)
 Returns the value of attribute $name. More...
 
 attributes ()
 Returns an array of supported attributes (only their names). More...
 
 getValueObject ()
 
 hasAttribute ($name)
 Returns true if object supports attribute $name. More...
 

Private Attributes

 $attributesMap
 
 $valueObject
 

Detailed Description

Generic adapter allowing any ValueObject implementation to be LegacyCompatible with the help of a hash map, mapping the legacy attributes name to the value object property name (e.g.

my_legacy_attribute_name => newPropertyName)

Constructor & Destructor Documentation

eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter::__construct ( ValueObject  $valueObject,
array  $attributesMap 
)
Parameters
\eZ\Publish\API\Repository\Values\ValueObject$valueObjectThe value object to decorate
array$attributesMapHash mapping legacy attribute name (key) to the embedded value object property name (value) Value can also be a closure which would be called directly with the value object as only parameter.

Member Function Documentation

eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter::attribute (   $name)

Returns the value of attribute $name.

Parameters
string$name
Exceptions
\InvalidArgumentExceptionIf $name is not supported as a valid attribute
Returns
mixed

Implements eZ\Publish\Core\MVC\Legacy\Templating\LegacyCompatible.

eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter::attributes ( )

Returns an array of supported attributes (only their names).

Returns
array

Implements eZ\Publish\Core\MVC\Legacy\Templating\LegacyCompatible.

eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter::getValueObject ( )
Returns
eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter::hasAttribute (   $name)

Returns true if object supports attribute $name.

Parameters
string$name
Returns
boolean

Implements eZ\Publish\Core\MVC\Legacy\Templating\LegacyCompatible.

Member Data Documentation

eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter::$attributesMap
private
eZ\Publish\Core\MVC\Legacy\Templating\Adapter\ValueObjectAdapter::$valueObject
private

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