eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\ImageConverter::fillXml PHP Method

fillXml() protected method

Fill the XML template with the data provided.
protected fillXml ( array $imageData, array $pathInfo, integer $timestamp ) : string
$imageData array
$pathInfo array
$timestamp integer
return string
    protected function fillXml($imageData, $pathInfo, $timestamp)
    {
        // <?xml version="1.0" encoding="utf-8"
        // <ezimage serial_number="1" is_valid="1" filename="River-Boat.jpg" suffix="jpg" basename="River-Boat" dirpath="var/ezdemo_site/storage/images/travel/peruvian-amazon/river-boat/322-1-eng-US" url="var/ezdemo_site/storage/images/travel/peruvian-amazon/river-boat/322-1-eng-US/River-Boat.jpg" original_filename="bbbbc2fe.jpg" mime_type="image/jpeg" width="770" height="512" alternative_text="Old River Boat" alias_key="1293033771" timestamp="1342530101">
        //   <original attribute_id="322" attribute_version="1" attribute_language="eng-US"/>
        //   <information Height="512" Width="770" IsColor="1"/>
        // </ezimage>
        $xml = <<<EOT
<?xml version="1.0" encoding="utf-8"?>
<ezimage serial_number="1" is_valid="%s" filename="%s"
    suffix="%s" basename="%s" dirpath="%s" url="%s"
    original_filename="%s" mime_type="%s" width="%s"
    height="%s" alternative_text="%s" alias_key="%s" timestamp="%s">
  <original attribute_id="%s" attribute_version="%s" attribute_language="%s"/>
  <information Height="%s" Width="%s" IsColor="%s"/>
</ezimage>
EOT;
        return sprintf($xml, $pathInfo['basename'] !== '' ? '1' : '', htmlspecialchars($pathInfo['basename']), htmlspecialchars($pathInfo['extension']), htmlspecialchars($pathInfo['filename']), htmlspecialchars($pathInfo['dirname']), htmlspecialchars($imageData['uri']), htmlspecialchars($pathInfo['basename']), htmlspecialchars($imageData['mime']), htmlspecialchars($imageData['width']), htmlspecialchars($imageData['height']), htmlspecialchars($imageData['alternativeText']), htmlspecialchars(1293033771), htmlspecialchars($timestamp), $imageData['fieldId'], $imageData['versionNo'], $imageData['languageCode'], $imageData['height'], $imageData['width'], 1);
    }