Another way to do it is to write a behaviour which does the alteration and include that in the actsAs array before the upload behaviour. They are run in order, so the upload behaviour will see what your behaviour did. That way you don't need to mess with the 3rd party code.
Simon http://www.simonellistonball.com/ On Apr 2, 1:30 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote: > yep just seen that. Guess that means no then can't be done. > > Unless customise the behaviour. > > I guess there is a reason for behaviors beforeSave being called before the > models beforeSave > > On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote: > > > > > Behavior beforeSave() callbacks are called before the Model's > > beforeSave() callback. > > > On Apr 2, 12:43 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote: > > > I have and Event Model that hasMany Photos > > > > I am using an upload behaviour and wish to save photos in a directory by > > the > > > event Slug > > > > the below code is in the photo model the actsAs infor is updated but the > > new > > > information is ignored > > > > function beforeSave() { > > > $this->actsAs['Upload']['src']['dir'].= '/' . > > > $this->getEventSlug($this->data['Photo']['event_id']); > > > return true; > > > } > > > > how can I get this to work? > > > > - S --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
