Пример #1
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         $this->slug = Helpers::getSlug($this->name);
         return true;
     } else {
         return false;
     }
 }
Пример #2
0
 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;
     }
 }