Browse Source

fix ZF-6601

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@15586 44c647ce-9c0f-0410-b52a-842ac1e357ba
stas 16 years ago
parent
commit
fdabf50576

+ 4 - 2
library/Zend/Amf/Parse/Amf0/Deserializer.php

@@ -261,7 +261,7 @@ class Zend_Amf_Parse_Amf0_Deserializer extends Zend_Amf_Parse_Deserializer
      * Commonly used for Value Objects on the server
      *
      * @todo   implement Typed Class mapping
-     * @return object
+     * @return object|array
      * @throws Zend_Amf_Exception if unable to load type
      */
     public function readTypedObject()
@@ -277,7 +277,9 @@ class Zend_Amf_Parse_Amf0_Deserializer extends Zend_Amf_Parse_Deserializer
                 $returnObject->$key = $value;
             }
         }
-
+	   if($returnObject instanceof Zend_Amf_Value_Messaging_ArrayCollection) {
+			$returnObject = get_object_vars($returnObject);
+	   }
         return $returnObject;
     }
 

+ 12 - 1
library/Zend/Amf/Parse/Amf3/Deserializer.php

@@ -273,7 +273,7 @@ class Zend_Amf_Parse_Amf3_Deserializer extends Zend_Amf_Parse_Deserializer
      * Read an object from the AMF stream and convert it into a PHP object
      *
      * @todo   Rather than using an array of traitsInfo create Zend_Amf_Value_TraitsInfo
-     * @return object
+     * @return object|array
      */
     public function readObject()
     {
@@ -389,7 +389,18 @@ class Zend_Amf_Parse_Amf3_Deserializer extends Zend_Amf_Parse_Deserializer
                     $returnObject->$key = $value;
                 }
             }
+			
+		  
         }
+		
+	   if($returnObject instanceof Zend_Amf_Value_Messaging_ArrayCollection) {
+		if(isset($returnObject->externalizedData)) {
+			$returnObject = $returnObject->externalizedData;
+		} else {
+			$returnObject = get_object_vars($returnObject);
+		}
+	   }
+	   
         return $returnObject;
     }
 

+ 2 - 0
library/Zend/Amf/Parse/TypeLoader.php

@@ -50,6 +50,7 @@ final class Zend_Amf_Parse_TypeLoader
         'flex.messaging.messages.CommandMessage'     => 'Zend_Amf_Value_Messaging_CommandMessage',
         'flex.messaging.messages.ErrorMessage'       => 'Zend_Amf_Value_Messaging_ErrorMessage',
         'flex.messaging.messages.RemotingMessage'    => 'Zend_Amf_Value_Messaging_RemotingMessage',
+        'flex.messaging.io.ArrayCollection'          => 'Zend_Amf_Value_Messaging_ArrayCollection',
     );
 
     /**
@@ -61,6 +62,7 @@ final class Zend_Amf_Parse_TypeLoader
         'flex.messaging.messages.CommandMessage'     => 'Zend_Amf_Value_Messaging_CommandMessage',
         'flex.messaging.messages.ErrorMessage'       => 'Zend_Amf_Value_Messaging_ErrorMessage',
         'flex.messaging.messages.RemotingMessage'    => 'Zend_Amf_Value_Messaging_RemotingMessage',
+        'flex.messaging.io.ArrayCollection'          => 'Zend_Amf_Value_Messaging_ArrayCollection',
     );
 
     /**

+ 34 - 0
library/Zend/Amf/Value/Messaging/ArrayCollection.php

@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Amf
+ * @subpackage Value
+ * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ */
+
+/**
+ * Type encapsulating Flex ArrayCollection
+ *
+ * Corresponds to flex.messaging.io.ArrayCollection
+ *
+ * @package    Zend_Amf
+ * @subpackage Value
+ * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ */
+class Zend_Amf_Value_Messaging_ArrayCollection
+{
+}