eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\AuthorConverter::generateXmlString PHP Method

generateXmlString() private method

Generates XML string from $authorValue to be stored in storage engine.
private generateXmlString ( array $authorValue ) : string
$authorValue array
return string The generated XML string
    private function generateXmlString(array $authorValue)
    {
        $doc = new DOMDocument('1.0', 'utf-8');
        $root = $doc->createElement('ezauthor');
        $doc->appendChild($root);
        $authors = $doc->createElement('authors');
        $root->appendChild($authors);
        foreach ($authorValue as $author) {
            $authorNode = $doc->createElement('author');
            $authorNode->setAttribute('id', $author['id']);
            $authorNode->setAttribute('name', $author['name']);
            $authorNode->setAttribute('email', $author['email']);
            $authors->appendChild($authorNode);
            unset($authorNode);
        }
        return $doc->saveXML();
    }