Just to add to my last msg:

The main reason that I kept on trying to use recordset was becouse of the pagination features built-in on the recordset class (the on-demand, fetch-all etc).

On 10/23/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote:
>This is one of the reasons I avoid returning recordsets from CakeAMFPHP, the
>other is because the DBConnection stuff makes the code specific to the remoting
>interface. Just returning the cake array structures allows you to keep the same
>code for both html and remoting sections.

Thanks for clarifying this, Martin. I also had this fog about which technique to use. The recordset way would also make it harder to implement your typemapper, I think.

 I guess gwoo used the recordset technique on the cakeamfbb sample?

Sorry if I'm missing something, but what does Arrayf stands for?

Marcelo.


On 10/23/06, Martin Wood-Mitrovski <[EMAIL PROTECTED]> wrote:


Marco Madarco wrote:
> Really good job guys! AMF + cake Model&Scaffolding is a dream.
> I've only a question:
> I started using cakeAMFPHP 0.6 (& cake 1.1.8.3544) some days ago and
> I'm having problem returning query results. After poking around the code
> for a while, it seems that CakeMySqlAdapter.php return only the results
> from last query, so it doesn't work if the model has some $has*
> relationships. I'm missing something?
> For now I've solved the problem returning an Arrayf.

No, youre not missing anything.

If you return a recordset then you wont get the right results if you are using
associative models and/or setting $model->recursive.

This is because the cake code performs a number of sql queries for one model
method and then does an array_merge with the results. So when you follow the
recordset technique of getting the response from the DBConnection it just
returns the results of the last query in the set, which is often empty. As you
found out using Arrayf is the best way to go.

This is one of the reasons I avoid returning recordsets from CakeAMFPHP, the
other is because the DBConnection stuff makes the code specific to the remoting
interface. Just returning the cake array structures allows you to keep the same
code for both html and remoting sections.


martin.

_______________________________________________
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