Neos\Neos\Service\Mapping\NodeReferenceConverter::convertFrom PHP Method

convertFrom() public method

public convertFrom ( Neos\ContentRepository\Domain\Model\NodeInterface | array $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : string
$source Neos\ContentRepository\Domain\Model\NodeInterface | array
$targetType string
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
return string the target type
    public function convertFrom($source, $targetType, array $convertedChildProperties = array(), PropertyMappingConfigurationInterface $configuration = null)
    {
        if (is_array($source)) {
            $result = [];
            /** @var NodeInterface $node */
            foreach ($source as $node) {
                $result[] = $node->getIdentifier();
            }
        } else {
            if ($source instanceof NodeInterface) {
                $result = $source->getIdentifier();
            } else {
                $result = '';
            }
        }
        return $result;
    }
NodeReferenceConverter