Neos\ContentRepository\Domain\Service\Context::getProperties PHP Method

getProperties() public method

Returns the properties of this context.
public getProperties ( ) : array
return array
    public function getProperties()
    {
        return array('workspaceName' => $this->workspaceName, 'currentDateTime' => $this->currentDateTime, 'dimensions' => $this->dimensions, 'targetDimensions' => $this->targetDimensions, 'invisibleContentShown' => $this->invisibleContentShown, 'removedContentShown' => $this->removedContentShown, 'inaccessibleContentShown' => $this->inaccessibleContentShown);
    }

Usage Example

 /**
  * Create a node for the given NodeData, given that it is a variant of the current node
  *
  * @param NodeData $nodeData
  * @return Node
  */
 protected function createNodeForVariant($nodeData)
 {
     $contextProperties = $this->context->getProperties();
     $contextProperties['dimensions'] = $nodeData->getDimensionValues();
     unset($contextProperties['targetDimensions']);
     $adjustedContext = $this->contextFactory->create($contextProperties);
     return $this->nodeFactory->createFromNodeData($nodeData, $adjustedContext);
 }