On Aug 19, 12:31 am, Zoltan <[EMAIL PROTECTED]> wrote:
> Hi
>
> I'm trying to figure out the syntax for creating an array in the
> proper format for grouping by as the old generateList method did (but
> using 1.2's find() instead)
>
> This is the array I have:
> Array
> (
>     [0] => Array
>         (
>             [ReviewTopic] => Array
>                 (
>                     [id] => 7
>                     [name] => Linux
>                     [review_category_id] => 'book'
>                 )
>
>         )
>
>     [1] => Array
>         (
>             [ReviewTopic] => Array
>                 (
>                     [id] => 19
>                     [name] => Software development
>                     [review_category_id] => 'book'
>                 )
>
>         )...
>
> ...and I'm trying to set it up so:
>
> ['book'] => array ( 7 => 'Linux', 19 => 'software development' );
>
> using the set::combine functions with something like ($reviewTopic has
> the record in the above form):
>
> $newList = Set::combine         (       $reviewTopic,
>                 '{n}.ReviewTopic.review_category_id',
>                 '{n}.ReviewTopic.id'
>         );
>
> Can anyone suggest something?

find('list', array('fields' => array('ReviewTopic.id',
'ReviewTopic.name', 'ReviewCategory.id'), 'recursive' => 0));
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to