예제 #1
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert) == false) {
         return false;
     }
     $this->blocks = Serializer::serialize($this->blocks);
     return true;
 }
예제 #2
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert) == false) {
         return false;
     }
     $this->captions = serialize($this->captions);
     return true;
 }
예제 #3
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert) == false) {
         return false;
     }
     if ($insert == true) {
         $this->status = StatusEnum::STATUS_ON;
     }
     return true;
 }
예제 #4
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         if ($insert == true) {
             $this->used = BooleanEnum::FLASE;
             return true;
         }
         return true;
     } else {
         return false;
     }
 }
예제 #5
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert) == false) {
         return false;
     }
     if ($insert == true) {
         $this->mode = 0;
         //0,1,2 分别代表适用于创建和解析.只能创建,只能解析
         $this->encodeParams = StatusEnum::STATUS_ON;
         $this->status = StatusEnum::STATUS_ON;
     }
     return true;
 }
예제 #6
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         if ($insert == true) {
             $this->status = StatusEnum::STATUS_ON;
         }
         $this->updateRevision();
         $this->short = StringHelper::truncate(empty($this->short) ? strip_tags($this->content) : $this->short, 200);
         return true;
     } else {
         return false;
     }
 }
예제 #7
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         if (empty($this->parent)) {
             $this->parent = 0;
         }
         if ($insert == true) {
             $this->status = StatusEnum::STATUS_ON;
         }
         return true;
     } else {
         return false;
     }
 }
예제 #8
0
 public function afterSave($insert, $changedAttributes)
 {
     if (parent::beforeSave($insert) == false) {
         return false;
     }
     if ($insert == true) {
         $this->updateCommentTotal();
         return true;
     }
     return true;
 }