text: ZF-6130: Strongly typed objects when sent either from client side or server side do not work till we specify a classMapping
  Description
  We use gateway.php as endpoint for Remoting Calls from Flash player. In order to expose a php file as a service we need to include it in the gateway.php file. Strongly typed objects(class objects) when sent either from client side or server side do not work till we specify a classMapping on gateway.php Something similar to: $server->setClassMap('Entity', 'Entity');
  Flex already has a remoteClass alias tag as a metadata on the client side classes which specifies its type on the server side.
  Example:
  package
  {
  [RemoteClass(alias="Entity")] // this is server side type public class Entity { public var id:int; } }
  This data is used while serializing and de-serializing the object. So, Zend should not be requiring this mapping on the server, as it is assumed that the client will always send the data with the same typing as on the server. If there is any other reason of keeping this mapping on gateway.php, at least the default behavior should be the one which is mentioned above for no mappings.
  Also, otherwise, the $explicitType variable in php classes provide the information about the type on the server. This variable if not specified make the strong typed objects as generic objects when sent to the client. This should also default to the class name if it is not specified, and should work as strongly typed objects on either side.
  Posted by Stanislav Malyshev (stas) on 2009-04-21T13:45:44.000+0000
  I've changed the serializer methods so that they will return class name and not empty for unknown classes, unless the class is stdClass (which will be just Object). Wade, if you could add test for that (I'm not sure how it's best to do it) that'd be great.
  Posted by Wade Arnold (wadearnold) on 2009-04-21T14:01:08.000+0000
  Looks like a pretty test case for the new functionality. Thanks stas! I'll put it in after work and merge it into the next mini release.
  wade
  Posted by Gaurav Priyadarshi (gauravp) on 2009-06-08T06:51:45.000+0000
  The fix provided is partial and works only if the function in php is not strongly typed like: function update($ item) { return "something"; }
  and we pass a class A say : package { [RemoteClass(alias="A")] public class A { public var i:int = 2; public function A() {
  }
  now since the class mapping is not done on the server, the php function receives a stdClass and works. But the issue is that when the php function is strongly types say: function update (A $item);
  PHP starts complaining the passed argument is of type stdClass instead of A.
  The fix for this can be achieved if the Deserializer figures out the type (specified by the remote class alias on the Actionscript class) and then instantiates the correct type on the server side.
  Posted by Stanislav Malyshev (stas) on 2009-06-09T12:52:28.000+0000
  The mapping works if the class in question (ARemote) exists or can be loaded. If it can not, then the mapping of course can not work. I tried your example and it worked for me just fine as soon as class ARemote is defined when server request is parsed. If you code does not work, please provide the full code.
  Posted by Gaurav Priyadarshi (gauravp) on 2009-06-10T02:53:44.000+0000
  Find the files in the attached zip file. The error that I receive is :
  Catchable fatal error: Argument 1 passed to Srv::test() must be an instance of ARemoteClass, instance of stdClass given in C:\wamp\www\TestZend1-debug\services\Srv.php on line 6
  Posted by Stanislav Malyshev (stas) on 2009-06-15T09:12:26.000+0000
  In your example, ARemoteClass is loaded too late - since requests are parsed before they are executed, when parsing the incoming packet the definition of ARemote class is not available.
  Posted by Gaurav Priyadarshi (gauravp) on 2009-06-15T22:47:51.000+0000
  If this is not supported can you provide a workaround for this scenario. Also, just to mention, AMFPHP, Blazeds and several other amf libraries support this.
  Posted by Stanislav Malyshev (stas) on 2009-07-04T15:08:30.000+0000
  Seems to be still questions about it, so reopening it to keep on my radar screen.
  Posted by cg (s3ct0r) on 2010-02-02T14:25:46.000+0000
  It seems this is still an issue, i've exposed my objects via the autoloader and loading works fine, however the AMF server still casts them to stdClass when they are incomming.
  Posted by Wade Arnold (wadearnold) on 2010-05-05T13:11:47.000+0000
  It looks like it is the transfer object that you are having issues with and not the service. ZF-9809 should make this a lot easier.
  Posted by Matthew Weier O'Phinney (matthew) on 2011-10-28T21:29:16.000+0000
  I believe this is now fixed in trunk as of r24543 and in the 1.11 release branch with r24544.
  One note: for typehinted arguments to get cast correctly, they must have an accompanying @param annotation in the docblock. As an example, this won't work:
  However, this will:
  This is due to a limitation in the PHP engine's Reflection API. The Reflection API for parameters can only return if the value expected is an array -- and not arbitrary object types.