public function setPostTextAttribute($value) { $bbcode = new BBCodeForDB($value); $this->attributes['post_text'] = $bbcode->generate(); $this->attributes['bbcode_uid'] = $bbcode->uid; $this->attributes['bbcode_bitfield'] = $bbcode->bitfield; }