TYPO3  7.6
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ObjectAccessorNode Class Reference
Inheritance diagram for ObjectAccessorNode:
AbstractNode NodeInterface

Public Member Functions

 __construct ($objectPath)
 
 getObjectPath ()
 
 evaluate (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Public Member Functions inherited from AbstractNode
 evaluateChildNodes (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 getChildNodes ()
 
 addChildNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface $childNode)
 

Static Public Member Functions

static getPropertyPath ($subject, $propertyPath,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 

Protected Attributes

 $objectPath
 
- Protected Attributes inherited from AbstractNode
 $childNodes = array()
 

Detailed Description

A node which handles object access. This means it handles structures like {object.accessor.bla}

Definition at line 17 of file ObjectAccessorNode.php.

Constructor & Destructor Documentation

__construct (   $objectPath)

Constructor. Takes an object path as input.

The first part of the object path has to be a variable in the TemplateVariableContainer.

Parameters
string$objectPathAn Object Path, like object1.object2.object3

Definition at line 34 of file ObjectAccessorNode.php.

References ObjectAccessorNode\$objectPath.

Member Function Documentation

Evaluate this node and return the correct object.

Handles each part (denoted by .) in $this->objectPath in the following order:

  • call appropriate getter
  • call public property, if exists
  • fail

The first part of the object path has to be a variable in the TemplateVariableContainer.

Parameters
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface$renderingContext
Returns
mixed The evaluated object, can be any object type.

Implements NodeInterface.

Definition at line 64 of file ObjectAccessorNode.php.

References ObjectAccessorNode\$objectPath.

getObjectPath ( )

Internally used for building up cached templates; do not use directly!

Returns
string

Definition at line 45 of file ObjectAccessorNode.php.

References ObjectAccessorNode\$objectPath.

static getPropertyPath (   $subject,
  $propertyPath,
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface  $renderingContext 
)
static

Gets a property path from a given object or array.

If propertyPath is "bla.blubb", then we first call getProperty($object, 'bla'), and on the resulting object we call getProperty(..., 'blubb').

For arrays the keys are checked likewise.

Parameters
mixed$subjectAn object or array
string$propertyPath
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface$renderingContext
Returns
mixed Value of the property

Definition at line 82 of file ObjectAccessorNode.php.

Member Data Documentation

$objectPath
protected