getProperty() public method

Get a single property reduced to a simple type (no objects) representation
public getProperty ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $propertyName ) : mixed
$node Neos\ContentRepository\Domain\Model\NodeInterface
$propertyName string
return mixed
 /**
  * Renders data attributes needed for the given node property.
  *
  * @param NodeInterface $node
  * @param string $propertyName
  * @return array
  */
 protected function renderNodePropertyAttribute(NodeInterface $node, $propertyName)
 {
     $attributes = [];
     /** @var $contentContext ContentContext */
     $contentContext = $node->getContext();
     // skip the node name of the site node - TODO: Why do we need this?
     if ($propertyName === '_name' && $node === $contentContext->getCurrentSiteNode()) {
         return $attributes;
     }
     $dataType = $node->getNodeType()->getPropertyType($propertyName);
     $dasherizedPropertyName = $this->dasherize($propertyName);
     $propertyValue = $this->nodePropertyConverterService->getProperty($node, $propertyName);
     $propertyValue = $propertyValue === null ? '' : $propertyValue;
     $propertyValue = !is_string($propertyValue) ? json_encode($propertyValue) : $propertyValue;
     if ($dataType !== 'string') {
         $attributes['data-nodedatatype-' . $dasherizedPropertyName] = 'xsd:' . $dataType;
     }
     $attributes['data-node-' . $dasherizedPropertyName] = $propertyValue;
     return $attributes;
 }