Set::combine($data, '{n}.Person.id', '{n}', '{n}.Person.group_id');

Note that the people will be indexed by their ids, but that shouldn't
be a problem.

hth
grigri


On Aug 25, 3:14 pm, MarcS <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have the following data
>
>   0: array =
>     Person: array =
>       id: long = 1
>       name: string = "n1"
>       group_id: long = 1
>   1: array =
>     Person: array =
>       id: long = 2
>       name: string = "n2"
>       group_id: long = 1
>   2: array =
>     Person: array =
>       id: long = 3
>       name: string = "n3"
>       group_id: long = 2
>
> What I would like an array that is grouped by the group_id
> The result should be
>   1: array =
>       0: array =
>           Person: array =
>           id: long = 1
>           name: string = "n1"
>           group_id: long = 1
>     1: array =
>         Person: array =
>         id: long = 2
>         name: string = "n2"
>         group_id: long = 1
>   2: array =
>      0: array =
>        Person: array =
>        id: long = 3
>        name: string = "n3"
>        group_id: long = 2
>
> Is that possible to do with the set class?
--~--~---------~--~----~------------~-------~--~----~
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