setBody($initBody); $this->setTitle($initTitle); $this->setType($initType); } /** * Gets the main text of the message. * @return the main text of the message */ public function getBody() { return $this->body; } /** * Sets the main text of the message. * HTML attributes are allowed and are sanitized by the container * @param newBody the main text of the message */ public function setBody($newBody) { $this->body = $newBody; } /** * Gets the title of the message * @return the title of the message */ public function getTitle() { return $this->title; } /** * Sets the title of the message * HTML attributes are allowed and are sanitized by the container. * @param newTitle the title of the message */ public function setTitle($newTitle) { $this->title = $newTitle; } /** * Gets the type of the message, as specified by opensocial.Message.Type * @return the type of message (enum Message.Type) */ public function getType() { return $this->type; } /** * Sets the type of the message, as specified by opensocial.Message.Type * @param newType the type of message (enum Message.Type) */ public function setType($newType) { if (! in_array($newType, $this->types)) { throw new Exception('Invalid message type'); } $this->type = $newType; } /** * TODO implement either a standard 'sanitizing' facility or * define an interface that can be set on this class so * others can plug in their own. * @param htmlStr String to be sanitized. * @return the sanitized HTML String */ public function sanitizeHTML($htmlStr) { return $htmlStr; } }