I found something but I'm not sure if it's correct:

$aro = $this->Acl->Aro;
$tree = $aro->behaviors["Tree"];

for a parent:

$tree->setup($aro,array("parent" => "Aro.id"));     // just "id"
doesn't work
$aro-
>save(array('model'=>'Roles','foreign_key'=>'0','alias'=>'Parent'));

for children:
$tree->setup($aro,array("parent" =>
"Aro.id","parent_id"=>"1"));     // 1 = Aro.id of the above 'Parent'
$aro-
>save(array('model'=>'Roles','foreign_key'=>'0','alias'=>'Child1'));
$aro-
>save(array('model'=>'Roles','foreign_key'=>'0','alias'=>'Child2'));
etc.


pr($aro) shows usefull informations.


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