toArray() as $key => $value) { $this->{$key} = $value; } // add additional attributes for the API try { $this->timestamp = strtotime(DateTimeFormat::local($this->date)); $this->msg_html = BBCode::convert($this->msg, false); $this->msg_plain = explode("\n", trim(HTML::toPlaintext($this->msg_html, 0)))[0]; } catch (\Exception $e) { } $this->date_rel = Temporal::getRelativeDate($this->date); } }