beforeSave() protected method

protected beforeSave ( )
Esempio n. 1
0
 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         if ($this->isNewRecord) {
             $this->object_type = 'product';
             Object::extraBeforeSave('create', $this);
         } else {
             Object::extraBeforeSave('update', $this);
         }
         return true;
     } else {
         return false;
     }
 }