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