private function persistReference(
        NodeInterface $node,
        DocumentAccessor $accessor,
        $fieldName,
        $locale,
        $fieldMapping
    ) {
        $referenceDocument = $accessor->get($fieldName);

        if (!$referenceDocument) {
            return;
        }

        if ($fieldMapping['multiple']) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Mapping references as multiple not currently supported (when mapping "%s")',
                    $fieldName
                )
            );
        }

        try {
            $referenceNode = $this->documentRegistry->getNodeForDocument($referenceDocument);
            $phpcrName = $this->encoder->encode($fieldMapping['encoding'], $fieldMapping['property'], $locale);
            $node->setProperty($phpcrName, $referenceNode);
        } catch (InvalidLocaleException $ex) {
            // arguments invalid, no valid propertyname could be generated (e.g. no locale given for localized encoding)
            return;
        }
    }