Well, I would scrap the groups_units HABTM association, as it isn't
really a direct association.  You can't add/remove those associations
directly, so it's really just a symptom of the main Group ->
Department -> Units association.

Now, to get the associated group ids from a unit, have something like:

$this->Unit->recursive = 2; // get the Departments, and the
Departments' Groups
$unit = $this->Unit->read(null, $unit_id);
$group_ids = Set::extract($unit, 'Department.{n}.Group.{n}.id';
$unique_group_ids = array_keys(array_flip($group_ids));


--~--~---------~--~----~------------~-------~--~----~
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