Where should I put parent::beforeSave() of a model?

I’m confused


protected function beforeSave()

{

   $this->update = ..

   $this->create = ..

		

   return parent::beforeSave();

}

or


protected function beforeSave()

{

   if (!parent::beforeSave())

      return false;


   $this->update = ..

   $this->create = ..

		

   return true;

}

the same goes to afterFind, init, beforeValidate, etc etc…

please help, thank you

beforeSave() raises “onBeforeSave” event, so if you have any event’s handlers, they will be executed. Now you can answer the question by yourself (it depends on your needs) :)