I came up with this solution, based on code from ACL behavior. I'm a
newbie so I may have missed something important. Any comments from a
pro will be welcomed.
I have added the following aftersave function to my user model:
function afterSave() {
if ($this->id) {
$type = 'Aro';
$parent = $this->parentNode();
if (!empty($parent)) {
$parent = $this->node($parent);
} else {
$parent = null;
}
$user = $this->node($this);
$this->{$type}->save(array(
'id' => Set::extract($user, "0.{$type}.id"),
'parent_id' => Set::extract($parent, "0.{$type}.id"),
'model' => $this->name,
'foreign_key' => $this->id
));
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---