Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function process()
 {
     parent::process();
     $this->result = array();
     foreach ($this->xmlResult->GetQueueAttributesResult->Attribute as $attribute) {
         $this->result[Inflector::snake(trim((string) $attribute->Name))] = trim((string) $attribute->Value);
     }
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 protected function process()
 {
     parent::process();
     $this->result = array();
     foreach ($this->xmlResult->ReceiveMessageResult->Message as $message) {
         $row = array('message_id' => trim((string) $message->MessageId), 'receipt_handle' => str_replace(' ', '', trim((string) $message->ReceiptHandle)), 'md5_of_body' => trim((string) $message->MD5OfBody), 'body' => trim((string) $message->Body));
         foreach ($message->Attribute as $attribute) {
             $row[Inflector::snake(trim((string) $attribute->Name))] = trim((string) $attribute->Value);
         }
         $this->result[] = $row;
     }
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 protected function process()
 {
     parent::process();
     if (strpos($this->getResponse()->getBody(true), '<?xml') !== false) {
         $body = $this->getResponse()->getBody(true);
         $body = preg_replace('# xmlns=[^ >]*#', '', $body);
         $this->result = new \SimpleXMLElement($body);
     }
     if ($this->result instanceof \SimpleXMLElement) {
         // @codeCoverageIgnoreStart
         if (empty($this->resultNode)) {
             $resultNode = $this->action . 'Result';
         } else {
             $resultNode = $this->resultNode;
         }
         // @codeCoverageIgnoreEnd
         if ($resultNode != '.') {
             $this->result = $this->result->{$resultNode};
         }
         // Iterable result
         if ($this instanceof AbstractIterableMwsCommand || $this instanceof AbstractIterableMwsOrderCommand) {
             $nextCommand = Inflector::snake($this->action . 'ByNextToken');
             $records = $this->result;
             if ($this->recordPath) {
                 $records = $this->result->xpath($this->recordPath);
             }
             // Get next token unless HasNext property is set to false
             if (!isset($this->result->NextToken)) {
                 $nextToken = null;
             } elseif (!empty($this->result->HasNext)) {
                 if ($this->result->HasNext == 'false') {
                     $nextToken = null;
                 }
             }
             $this->result = new ResultIterator($this->getClient(), array('next_token' => $nextToken, 'next_command' => $nextCommand, 'resources' => $records, 'result_node' => $resultNode, 'record_path' => $this->recordPath));
         } else {
             if (!empty($this->recordPath)) {
                 $this->result = $this->result->xpath($this->recordPath);
             }
         }
     } else {
         if ($this->result->getContentType() == 'application/octet-stream') {
             // Get CSV data array
             $this->result = new CsvReport($this->getResponse()->getBody(true));
         }
     }
 }