public function describeDistributions(MarkerType $marker = null)
{
$result = null;
$options = array();
$aQueryString = array();
if ($marker !== null) {
if ($marker->marker !== null) {
$aQueryString[] = 'Marker=' . self::escape($marker->marker);
}
if ($marker->maxItems !== null) {
$aQueryString[] = 'MaxItems=' . self::escape($marker->maxItems);
}
}
$response = $this->client->call('GET', $options, '/distribution' . (!empty($aQueryString) ? '?' . join('&', $aQueryString) : ''));
if ($response->getError() === false) {
$sxml = simplexml_load_string($response->getRawContent());
$result = new DistributionList();
$result->setCloudFront($this->cloudFront);
$result->setMarker($this->exist($sxml->Marker) ? (string) $sxml->Marker : null);
$result->setMaxItems($this->exist($sxml->MaxItems) ? (int) $sxml->MaxItems : null);
$result->setIsTruncated($this->exist($sxml->IsTruncated) ? (string) $sxml->IsTruncated == 'true' : null);
if (!empty($sxml->Items->DistributionSummary)) {
foreach ($sxml->Items->DistributionSummary as $v) {
$item = $this->_loadDistributionData($v);
$result->append($item);
unset($item);
}
}
}
return $result;
}