Hi Marco,

This *action*_count is a built-in feature of amfphp, right? What code should be on the client side for this to work? (AFAIK it only works when you are using the recordset class).

Also, why do you wrap the array returned by Cake into the Arrayf object?

Cheers,

Marcelo.

On 10/24/06, Marco Madarco <[EMAIL PROTECTED]> wrote:
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 = ""> $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

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to