3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
23 * http://opensocial-resources.googlecode.com/svn/spec/draft/OpenSocial-Specification.xml#opensocial.Message.Field
26 // These fields should be referenced via getters and setters. 'public' only for json_encode.
30 public $collectionIds;
44 public static $DEFAULT_FIELDS = array('appUrl', 'body', 'bodyId',
45 'collectionIds', 'id', 'inReplyTo', 'recipients', 'replies',
46 'senderId', 'status', 'timeSent', 'title', 'titleId', 'type',
49 public static $TYPES = array(
52 /* A short private message */
54 /* A message to a specific user that can be seen only by that user */
56 /* A message to a specific user that can be seen by more than that user */
59 public static $STATUS = array('NEW', 'READ', 'DELETED');
61 public function __construct($id, $title) {
63 $this->setTitle($title);
66 public function getAppUrl() {
70 public function setAppUrl($url) {
74 public function getBody() {
78 public function setBody($body) {
82 public function getBodyId() {
86 public function setBodyId($bodyId) {
87 $this->bodyId
= $bodyId;
90 public function getCollectionIds() {
91 return $this->collectionIds
;
94 public function setCollectionIds($collectionIds) {
95 $this->$collectionIds = $collectionIds;
98 public function getId() {
102 public function setId($id) {
106 public function getInReplyTo() {
107 return $this->inReplyTo
;
110 public function setInReplyTo($inReplyTo) {
111 $this->inReplyTo
= $inReplyTo;
114 public function getRecipients() {
115 return $this->recipients
;
118 public function setRecipients($recipients) {
119 $this->recipients
= $recipients;
122 public function getReplies() {
123 return $this->replies
;
126 public function setReplies($replies) {
127 $this->replies
= $replies;
130 public function getStatus() {
131 return $this->status
;
134 public function setStatus($status) {
135 $this->status
= $status;
138 public function getSenderId() {
139 return $this->senderId
;
142 public function setSenderId($senderId) {
143 $this->senderId
= $senderId;
146 public function getTimeSent() {
147 return $this->timeSent
;
150 public function setTimeSent($timeSent) {
151 $this->timeSent
= $timeSent;
154 public function getTitle() {
158 public function setTitle($title) {
159 $this->title
= $title;
162 public function getTitleId() {
163 return $this->titleId
;
166 public function setTitleId($titleId) {
167 $this->titleId
= $titleId;
170 public function getType() {
174 public function setType($type) {
178 public function getUpdated() {
179 return $this->updated
;
182 public function setUpdated($updated) {
183 $this->updated
= $updated;
187 * Gets the URLs related to the message
188 * @return the URLs related to the person, their webpages, or feeds
190 public function getUrls() {
195 * Sets the URLs related to the message
196 * @param urls the URLs related to the person, their webpages, or feeds
198 public function setUrls($urls) {
203 * TODO implement either a standard 'sanitizing' facility or
204 * define an interface that can be set on this class so
205 * others can plug in their own.
206 * @param htmlStr String to be sanitized.
207 * @return the sanitized HTML String
209 public function sanitizeHTML($htmlStr) {