convertFrom() public méthode

If $source is a UUID it is expected to refer to the identifier of a NodeData record of the "live" workspace Otherwise $source has to be a valid node path: The node path must be an absolute context node path and can be specified as a string or as an array item with the key "__contextNodePath". The latter case is for updating existing nodes. This conversion method does not support / allow creation of new nodes because new nodes should be created through the createNode() method of an existing reference node. Also note that the context's "current node" is not affected by this object converter, you will need to set it to whatever node your "current" node is, if any. All elements in the source array which start with two underscores (like __contextNodePath) are specially treated by this converter. All elements in the source array which start with a *single underscore (like _hidden) are *directly* set on the Node object. All other elements, not being prefixed with underscore, are properties of the node.
public convertFrom ( string | array $source, string $targetType = null, array $subProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : mixed
$source string | array Either a string or array containing the absolute context node path which identifies the node. For example "/sites/mysitecom/homepage/about@user-admin"
$targetType string not used
$subProperties array not used
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
Résultat mixed An object or \Neos\Error\Messages\Error if the input format is not supported or could not be converted for other reasons
 /**
  * @test
  */
 public function convertFromDecodesJsonEncodedArraysAsAssociative()
 {
     $contextPath = '/foo/bar@user-demo';
     $nodePath = '/foo/bar';
     $nodeTypeProperties = array('quux' => array('type' => 'array'));
     $decodedPropertyValue = array('foo' => 'bar');
     $source = array('__contextNodePath' => $contextPath, 'quux' => json_encode($decodedPropertyValue));
     $mockNode = $this->setUpNodeWithNodeType($nodePath, $nodeTypeProperties);
     $mockNode->expects($this->once())->method('setProperty')->with('quux', $decodedPropertyValue);
     $this->nodeConverter->convertFrom($source, null, array(), $this->mockConverterConfiguration);
 }
 /**
  * Helper which calls the NodeConverter; with some error-handling built in
  *
  * @param $nodePath
  * @return NodeInterface
  */
 protected function convert($nodePath, PropertyMappingConfiguration $propertyMappingConfiguration = null)
 {
     $nodeConverter = new NodeConverter();
     $result = $nodeConverter->convertFrom($nodePath, null, array(), $propertyMappingConfiguration);
     if ($result instanceof Error) {
         $this->fail('Failed with error: ' . $result->getMessage());
     }
     return $result;
 }