Ejemplo n.º 1
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         $this->sid = Text::sid($this->sid, $this->header);
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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;
     }
 }