I would do:
$results = $this->Person->Group->findById($thegroupidyouwant);

This will return the group with a given id and all it's children the
people associated with the group should be in $results['Person']

Dave

On Jan 16, 6:19 am, RLR <[EMAIL PROTECTED]> wrote:
> Hi
>
> I am working on an addressbook app with two basic models:
> people and groups
>
> They are related via a HABTM relationship and a join table
>
> Tables:
> people
>   `id`
>   `firstname`
>   `lastname`
>   etc.
> groups
>   `id`
>   `name`
> groups_people
>   `id`
>   `person_id`
>   `group_id`
>
> I would like to be able to retrieve all people who are associated with
> a group from within the people_controller.
> $this->Person->findAll() will not work because the field group.id do
> not exist in the people table. Is there a cakephp specific way to do
> this for HABTM associations or do I have to do two or more special
> queries?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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