[fw-core] Zend AMF and setClass method

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[fw-core] Zend AMF and setClass method

Romain Pouclet
Hi all,

I'm working on a Symfony2 application (sorry ;-)) but I'd like to use Zend AMF so it can communicate with another Flex application. I've used the following code (https://gist.github.com/955136) :

<?php
$server = new \Zend\Amf\Server();
$server->setClass(new SuperServiceTestClass());
$server->setClassMap('com.palleas.timeline.TimelineElement', 'Palleas\\TimelineBundle\\Document\\TimelineElement');
$serverResponse = $server->handle();


It works fine, but there is something I don't understand : it's possible to call the setClass method using a class instance as the first parameter, but it calls get_class() inside and store my class' name : my instance is "lost".

I was wondering why it is done this way? Wouldn't it be possible to store my instance so it can be called directly?

Thanks !

--
Romain Pouclet