id = $notify->id; $this->type = $notify->type; $this->name = $notify->name; $this->url = $notify->url->__toString(); $this->photo = $notify->photo->__toString(); $this->date = DateTimeFormat::local($notify->date->format(DateTimeFormat::MYSQL)); $this->msg = $notify->msg; $this->uid = $notify->uid; $this->link = $notify->link->__toString(); $this->iid = $notify->itemId; $this->parent = $notify->parent; $this->seen = $notify->seen; $this->verb = $notify->verb; $this->otype = $notify->otype; $this->name_cache = $notify->name_cache; $this->msg_cache = $notify->msg_cache; $this->timestamp = (int) $notify->date->format('U'); $this->date_rel = Temporal::getRelativeDate($this->date); try { $this->msg_html = BBCode::convertForUriId($notify->uriId, $this->msg, BBCode::EXTERNAL); } catch (\Exception $e) { $this->msg_html = ''; } try { $this->msg_plain = explode("\n", trim(HTML::toPlaintext($this->msg_html, 0)))[0]; } catch (\Exception $e) { $this->msg_plain = ''; } } }