Hi,

In a model I'm working on, I need to add some functionality before and 
after saving a new record. I had initially implemented this in the 
beforeSave() and afterSave() methods. However, I realized I could do the 
work in one place by reimplementing Model->save() with the code from 
beforeSave() and afterSave(), and calling parent::save($data) between. I 
tested it, and it works fine.

What's the recommended way to do this? Reimplementing Model->save() 
enhances readability in my opinion, but if this breaks anything I'll revert 
to the callbacks.

Cheers, Ketil

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to