/** * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode $node * @return array * @see convert() */ protected function convertObjectAccessorNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode $node) { return array('initialization' => '', 'execution' => sprintf('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode::getPropertyPath($renderingContext->getTemplateVariableContainer(), \'%s\', $renderingContext)', $node->getObjectPath())); }
/** * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode $node * @return array * @see convert() */ protected function convertObjectAccessorNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode $node) { $objectPathSegments = explode('.', $node->getObjectPath()); $firstPathElement = array_shift($objectPathSegments); if ($objectPathSegments === array()) { return array('initialization' => '', 'execution' => sprintf('$currentVariableContainer->getOrNull(\'%s\')', $firstPathElement)); } else { $executionCode = '\\TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode::getPropertyPath($currentVariableContainer->getOrNull(\'%s\'), \'%s\', $renderingContext)'; return array('initialization' => '', 'execution' => sprintf($executionCode, $firstPathElement, implode('.', $objectPathSegments))); } }