Hi,
I am playing around with the new Zend_Amf which provides communcation
between Adobe Flex and PHP. I know there is at least one symfony
plugin, which uses SabreAmf but I had some issues with it. I decided
to give Zend_Amf a try and it worked much better, after some
modifications.
Zend_Amf serializes and deserializes objects looking for its public
properties. By default you can access the object public properties by
to iterating on the object using something like foreach($object as
$key => $value). Now, Symfony/Propel objects do not have public
properties, they are accessed using set()/get() methods, so Zend_Amf
did not work out of the box.
I found it worked by making modifications, having two options:
1) Modify the Zend_Amf serialiazer/desarializer to use
toArray()/fromArray() when it has to work on an object of class
BaseObject. This would require to request/make modifications on the
Zend Framework library and I would be surprise if they would be
willing to make those changes when this has nothing to do with ZF.
2) Mody the Symfony/Propel object by implementing the
IteratorAggregate interface, so when using foreach() on an object it
would iterate over the "properities" of the object by using
toArray()/fromArray() to access/set the data. This would require to
modify all propel generated objects to add something like this:
class Server extends BaseServer implements IteratorAggregate
{
// Required definition of interface IteratorAggregate
public function getIterator()
{
$return = new ArrayIterator( $this->toArray() );
return $return;
}
I would like to know what the core developers think about this and if
it would be a bad idea to incorporate the implementation of the
IteratorAggregate interface on base objetcs.
I believe that the Zend_Amf component will become the main way to
connect PHP and Adobe Flex since Adobe is throwing full support over
it, and since we already have a very easy and seemless way to
integrate Symfony and Zend Framework it would greatly benefit Symfony.
Pablo Godel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---