Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function process()
 {
     $xml = new \SimpleXMLElement($this->getResponse()->getBody(true));
     while ($xml instanceof \SimpleXMLElement) {
         // Add the results to the list of domains
         foreach ($xml->ListDomainsResult->DomainName as $domain) {
             $this->domains[] = (string) $domain;
         }
         $nextToken = (string) $xml->ListDomainsResult->NextToken;
         // If the command has been instructed to iterate over responses,
         // do so now by issuing subsequent requests until no NextToken is
         // returned in the responses
         if (!$this->get('iterate') || !$nextToken) {
             break;
         } else {
             $command = new self();
             $command->setIterate(false)->setMaxDomains($this->get('max_domains', 100))->setNextToken($nextToken);
             try {
                 $this->getClient()->execute($command);
                 $xml = new \SimpleXMLElement($command->getResponse()->getBody(true));
                 unset($command);
             } catch (HttpException $e) {
                 // @codeCoverageIgnoreStart
                 $ex = new SimpleDbException($e->getMessage());
                 throw $ex;
                 // @codeCoverageIgnoreEnd
             }
         }
     }
     $this->result = array_unique($this->domains);
 }