[osflash] [announcement] CakeAMFPHP 0.6.0 released
Marco Madarco
osflash at madarco.it
Tue Oct 24 08:36:18 EDT 2006
Marcelo de Moraes Serpa ha scritto:
> Yes too. Ever since I started using CakeAMFPHP I never really thought or
> needed to use recordsets. And about the paging feature, I guess I could
> easily implement a custom paging system myself without using the built-in
> recordset.
>
If it can help, it is easy to implement the AMF paging feature:
returning an Arrayf and implementing the method *action*_count:
/**
* @access remote
* @pagesize 25
*/
function getFoo($offset=0, $limit=25) {
...
$data = $this->Foo->findAll(...);
$r = _arrayft($data, 'Foo');
return new Arrayf($r, array_keys($r[0]));
}
function getFoo_count() { ... }
In the function _arrayft you should take care of the kind of associative
array returned by findAll:
array( [0] => array([TABLE] => array(data))) if there is only a single table
array( [TABLE] => array(data) ) otherwise.
I haven't find an easy way to join the arrays if multiple tables are
returned, any suggestion? :)
--
Marco Madarco
More information about the osflash
mailing list