Selaa lähdekoodia

fix for ZF-9050: allow Zend_Service_Amazon_Sqs::getAttribute to return multiple attributes

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21314 44c647ce-9c0f-0410-b52a-842ac1e357ba
stas 16 vuotta sitten
vanhempi
commit
d0f9b59aa1
1 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 10 2
      library/Zend/Service/Amazon/Sqs.php

+ 10 - 2
library/Zend/Service/Amazon/Sqs.php

@@ -298,8 +298,16 @@ class Zend_Service_Amazon_Sqs extends Zend_Service_Amazon_Abstract
             require_once 'Zend/Service/Amazon/Sqs/Exception.php';
             throw new Zend_Service_Amazon_Sqs_Exception($result->Error->Code);
         }
-
-        return (string) $result->GetQueueAttributesResult->Attribute->Value;
+        
+        if(count($result->GetQueueAttributesResult->Attribute) > 1) {
+            $attr_result = array();
+            foreach($result->GetQueueAttributesResult->Attribute as $attribute) {
+                $attr_result[(string)$attribute->Name] = (string)$attribute->Value;
+            }
+            return $attr_result;
+        } else {
+            return (string) $result->GetQueueAttributesResult->Attribute->Value;
+        }
     }
 
     /**