Example #1
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert) == false) {
         return false;
     }
     if ($insert == true) {
         $this->status = StatusEnum::STATUS_ON;
     }
     return true;
 }
Example #2
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         if ($insert == true) {
             $this->used = BooleanEnum::FLASE;
             return true;
         }
         return true;
     } else {
         return false;
     }
 }
 public function afterFind()
 {
     parent::afterFind();
     $captions = unserialize($this->captions);
     $result = [];
     if (!empty($captions)) {
         foreach ($captions as $caption) {
             $result[] = new CaptionForm($caption);
         }
     }
     $this->setAttribute("captions", $result);
 }
Example #4
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;
 }
Example #5
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;
     }
 }
Example #6
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;
     }
 }
Example #7
0
 public function afterDelete()
 {
     parent::afterDelete();
     $this->updateCommentTotal();
 }
Example #8
0
 public function afterFind()
 {
     parent::afterFind();
     $this->blocks = Serializer::unserialize($this->blocks);
 }