Exemple #1
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert) == false) {
         return false;
     }
     if ($insert == true) {
         $this->status = StatusEnum::STATUS_ON;
     }
     return true;
 }
Exemple #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);
 }
Exemple #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;
 }
Exemple #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;
     }
 }
Exemple #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;
     }
 }
Exemple #7
0
 public function afterDelete()
 {
     parent::afterDelete();
     $this->updateCommentTotal();
 }
Exemple #8
0
 public function afterFind()
 {
     parent::afterFind();
     $this->blocks = Serializer::unserialize($this->blocks);
 }