Details
-
Type:
Improvement
-
Status:
Postponed
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 1.7.5
-
Fix Version/s: None
-
Component/s: Zend_Amf
-
Labels:None
Description
Wade hi, I know this may sound impossible, but I have been working on a project using Zend_AMF and found out that when I use the $_explicitType method of class mapping in my project things become difficult. When using the $_explicitType method I get objects from PHP into Flex but when I try to send 1 object from Flex to PHP I get the channel diconnected error. I then switched to using the $server->setClassMap method and everything works fine. I have visited several blogs on this issue and no one has figured it out. I even found about 3 posts with similar problems in different blogs but no solution. I have continued building my application using the setClassMap method and each time I download an update (last tested 1.7.5) of the Zend_AMF I check to see if it would work but it's still not working. So please check this out. May be I am not doing something right. Thanks.
N.B - you can use Mihai's sample for a quick test : http://corlan.org/downloads/flex_php.zip.
- just comment out the //$server->setClassMap("VOAuthor", "VOAuthor");
and add the public $_explicitType ='VOAuthor' and you would not be able to update data in the datagrid.
After reading a whole lot about this "issue" i have discovered it is not such a trivial task.
Wade, you should check out SabreAMF and offer those features in Zend_AMF also.
They have a way of settings your own class mapping callback functions.
The issue with classmapping in php will and always be the loading/autoloading of classes, it is just the way php works.
One sollutions will be to create a certain convention on class mapping, but this is limiting, the best way is leave it as it is and add support for overriding class maping through custom callback functions, just as SabreAMF does, please take a look, it will get you rid of a lot of problems and questions.