public function beforeSave($insert) { if (parent::beforeSave($insert)) { if ($this->scenario == self::SCENARIO_PASSWORD_CHANGE) { $this->setPassword($this->passwordNew); } return true; } else { return false; } }
public function beforeSave($insert) { if (parent::beforeSave($insert)) { // $this->start = DDateTimeHelper::DateToUnix($this->date_from, $this->time_from); // $this->end = DDateTimeHelper::DateToUnix($this->date_to, $this->time_to); //echo'<pre>';print_r($this);echo'</pre>';die; return true; } else { return false; } }
/** * @inheritdoc */ public function beforeSave($insert) { if (parent::beforeSave($insert)) { if ($this->isNewRecord || !$this->isNewRecord && $this->password) { $this->setPassword($this->password); $this->generateAuthKey(); $this->generatePasswordResetToken(); } return true; } return false; }
public function beforeSave($insert) { if ($insert) { // $this->addEventLog(EventLog::ACTION_ADD_ORDER); } else { $old = $this->getOldAttributes(); $new = $this->getAttributes(); $this->attributes_diff = array_diff_assoc($new, $old); } return parent::beforeSave($insert); }