I don't know this for sure but it would be a place to start. I would guess that the beforeDelete callback for your Photo Model will be called even though the records are being deleted as dependent associations of your Album. I would put your file delete method in your beforeDelete callback of your Photo Model and see how that works.
If not, you might have to call the method manually from the beforeDelete callback of your Album model. again, i haven't tested this theory but based on my small experience with Cake I would have said it would do this successfully. cheers, mikee On 16/12/06, 2000Man <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a model Photalbums and a model Photo's. Photo's have a entry in > the database, but also a imagefile on the filesystem. Photomodel has > his own method delete, which deletes the database entry > (parent::delete) as well as the imagefile. > > In photoalbums, the relationship is set to dependent=true. This works > more or less: when I delete a photoalbum, the associated photos are > deleted from the database. > > But what I would like is that the method delete from this model is > being used, instead of just generating the mysql queries. Is the > already possible, or would it otherwise be usefull to add this > functionality? > > Tnxs in advance, > 2000Man > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
