public function beforeSave($insert) { if (parent::beforeSave($insert)) { $this->sid = Text::sid($this->sid, $this->header); return true; } else { return false; } }
public function beforeSave($insert) { if (parent::beforeSave($insert)) { $this->sid = Text::sid($this->sid, $this->header); $this->updated_at = date('YmdHis'); if ($this->isNewRecord) { $this->created_at = date('YmdHis'); } return true; } else { return false; } }
public function beforeSave($insert) { if (parent::beforeSave($insert)) { if ($this->pid === '0') { $this->pid = null; } $this->sid = Text::sid($this->sid, $this->header); if ($this->sid === '') { $this->addError('sid', 'Строковый идентификатор не смог создасться из заголовка, измените заголовок.'); return false; } return true; } else { return false; } }