I just realised that I forgot to mention that I am using Cake version 
1.1.19.6305

Langdon


Langdon Stevenson wrote:
> Hi,
> 
> I have just resolved a small ACL issue, but am interested to know if 
> there might any problems with what I have done.
> 
> If I delete a use in my application I also need to delete their ARO, 
> otherwise it becomes an orphan.  To do this I use:
> 
>    $this->Aro->del($id);
> 
> This works fine, but since the ARO model doesn't have a "dependent" 
> relationship with the ArosAco (the join table between AROs and ACOs) 
> then I end up with orphaned joins.
> 
> To fix this I have patched the ARO model file aro.php in the Cake core 
> so that it has the dependent flag set like this:
> 
> 
> var $hasMany = array(
>    'ArosAco' =>
>      array(
>        'className' => 'ArosAco',
>        'conditions'    => '',
>        'order'         => '',
>        'limit'         => '',
>        'foreignKey'    => '',
>        'dependent'     => true,
>        'exclusive'     => '',
>        'finderQuery'   => '',
>        'fields'        => '',
>        'offset'        => '',
>        'counterQuery'  => ''
>      )
>    );
> 
> 
> The solution appears (!?) to work nicely.  When I delete an Aro its 
> joins are also deleted.  I was surprised to find that this wasn't the 
> default arrangement, which makes me wonder am I missing something?
> 
> Can anyone tell me if this is a bad way to be solving this problem?
> 
> Regards,
> Langdon
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

  • Deleting AROs Langdon Stevenson
    • Re: Deleting AROs Langdon Stevenson

Reply via email to