I am aware of functionality of function beforeSave()
in YII that this function is used to perform something, which we want to perform before our data saved.
However, as far as we want to implement this before our data got save to database, can't we directly write this code before save() is calling (-> save () is storing out records to database )
Hence, I am not sure why exactly we need to create specific function like beforeSave () to perform action which we need to fire before Save() called, when we directly write that code before save() line as well.
can someone please explain this ? I have searched lot for reason of this but on every page, it redirect to explanation of beforeSave() function only.