public function beforeSave($insert) { if (parent::beforeSave($insert)) { $this->slug = Helpers::getSlug($this->name); return true; } else { return false; } }
public function beforeSave($insert) { if (parent::beforeSave($insert)) { $this->slug = Helpers::getSlug($this->title); if ($insert) { $this->date = date('Y-m-d'); } return true; } else { return false; } }