S3::__getCloudFrontInvalidationBatchXML PHP Method

__getCloudFrontInvalidationBatchXML() private static method

Get a InvalidationBatch DOMDocument
private static __getCloudFrontInvalidationBatchXML ( array $paths, integer $callerReference = '0' ) : string
$paths array Paths to objects to invalidateDistribution
$callerReference integer
return string
    private static function __getCloudFrontInvalidationBatchXML($paths, $callerReference = '0')
    {
        $dom = new DOMDocument('1.0', 'UTF-8');
        $dom->formatOutput = true;
        $invalidationBatch = $dom->createElement('InvalidationBatch');
        foreach ($paths as $path) {
            $invalidationBatch->appendChild($dom->createElement('Path', $path));
        }
        $invalidationBatch->appendChild($dom->createElement('CallerReference', $callerReference));
        $dom->appendChild($invalidationBatch);
        return $dom->saveXML();
    }