Issues

ZF-6433: PHP VO's don't return fields prefixed with "_" to Actionscript.

Issue Type: Bug Created: 2009-04-27T00:03:59.000+0000 Last Updated: 2009-05-11T20:40:36.000+0000 Status: Closed Fix version(s): Reporter: caspar harmer (rapsac) Assignee: Wade Arnold (wadearnold) Tags: - Zend_Amf

Related issues: Attachments:

Description

Any fields prefixed with "" will be explicitly excluded by the amf3 serializer. This is in lines 288-317 of Serializer.php. I had to downgrade to the old serializer to get it to work. Removing the check for "" in the parameter name would work also, but I am not sure why this is here. Perhaps a different routine should be use for the body of the message. Here is the code: switch($encoding) { case Zend_Amf_Constants::ET_PROPLIST: $count = 0; foreach($object as $key => $value) { if( $key[0] != "_") { $count++; } } $traitsInfo |= ($count << 4);

                // Write the object ID
                $this->writeInteger($traitsInfo);

                // Write the classname
                $this->writeString($className);

                // Write the object Key's to the output stream
                foreach ($object as $key => $value) {
                    if( $key[0] != "_") {
                        $this->writeString($key);
                    }
                }

                //Write the object values to the output stream.
                foreach ($object as $key => $value) {
                    if( $key[0] != "_") {
                        $this->writeTypeMarker($value);
                    }
                }
                break;

Comments

Posted by Wade Arnold (wadearnold) on 2009-05-11T20:40:35.000+0000

using an underscore is a common naming practice for private and protected variables in PHP. This variables become transient variables that do not need to be passed between php and AS as only public variables can be mapped on it's counterpart.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts