Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
9.09% |
1 / 11 |
|
9.09% |
1 / 11 |
CRAP | |
0.00% |
0 / 1 |
Message | |
9.09% |
1 / 11 |
|
9.09% |
1 / 11 |
101.91 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getFrom | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setFrom | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getTo | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setTo | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getBody | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setBody | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getStatus | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setStatus | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | /** |
4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License |
6 | * as published by the Free Software Foundation; under version 2 |
7 | * of the License (non-upgradable). |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | * |
18 | * Copyright (c) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung |
19 | * (under the project TAO-TRANSFER); |
20 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
21 | * (under the project TAO-SUSTAIN & TAO-DEV); |
22 | * 2013 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
23 | * |
24 | */ |
25 | |
26 | namespace oat\tao\model\messaging; |
27 | |
28 | use oat\oatbox\user\User; |
29 | |
30 | /** |
31 | * Message to be send to an user |
32 | * |
33 | * @access public |
34 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
35 | * @package tao |
36 | */ |
37 | class Message |
38 | { |
39 | /** |
40 | * Short description of attribute STATUS_WAITING |
41 | * |
42 | * @access public |
43 | * @var int |
44 | */ |
45 | public const STATUS_WAITING = 2; |
46 | |
47 | /** |
48 | * Short description of attribute STATUS_SENT |
49 | * |
50 | * @access public |
51 | * @var int |
52 | */ |
53 | public const STATUS_SENT = 3; |
54 | |
55 | /** |
56 | * Short description of attribute STATUS_ERROR |
57 | * |
58 | * @access public |
59 | * @var int |
60 | */ |
61 | public const STATUS_ERROR = 4; |
62 | |
63 | /** |
64 | * Short description of attribute from |
65 | * |
66 | * @access protected |
67 | * @var string |
68 | */ |
69 | protected $from = ''; |
70 | |
71 | /** |
72 | * @var User |
73 | */ |
74 | protected $to = null; |
75 | |
76 | /** |
77 | * Short description of attribute title |
78 | * |
79 | * @access protected |
80 | * @var string |
81 | */ |
82 | protected $title = ''; |
83 | |
84 | /** |
85 | * Short description of attribute body |
86 | * |
87 | * @access protected |
88 | * @var string |
89 | */ |
90 | protected $body = ''; |
91 | |
92 | /** |
93 | * Short description of attribute status |
94 | * |
95 | * @access protected |
96 | * @var int |
97 | */ |
98 | protected $status = 0; |
99 | |
100 | // --- OPERATIONS --- |
101 | |
102 | /** |
103 | * Short description of method __construct |
104 | * |
105 | * @access public |
106 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
107 | * @return mixed |
108 | */ |
109 | public function __construct() |
110 | { |
111 | $this->status = self::STATUS_WAITING; |
112 | } |
113 | |
114 | /** |
115 | * Short description of method getFrom |
116 | * |
117 | * @access public |
118 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
119 | * @return string |
120 | */ |
121 | public function getFrom() |
122 | { |
123 | return (string) $this->from; |
124 | } |
125 | |
126 | /** |
127 | * Short description of method setFrom |
128 | * |
129 | * @access public |
130 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
131 | * @param string from |
132 | * @return mixed |
133 | */ |
134 | public function setFrom($from) |
135 | { |
136 | $this->from = $from; |
137 | } |
138 | |
139 | /** |
140 | * User the message is to be send to |
141 | * |
142 | * @access public |
143 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
144 | * @return User |
145 | */ |
146 | public function getTo() |
147 | { |
148 | return $this->to; |
149 | } |
150 | |
151 | /** |
152 | * Short description of method setTo |
153 | * |
154 | * @access public |
155 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
156 | * @param string to |
157 | */ |
158 | public function setTo(User $to) |
159 | { |
160 | $this->to = $to; |
161 | } |
162 | |
163 | /** |
164 | * Short description of method getTitle |
165 | * |
166 | * @access public |
167 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
168 | * @return string |
169 | */ |
170 | public function getTitle() |
171 | { |
172 | return (string) $this->title; |
173 | } |
174 | |
175 | /** |
176 | * Short description of method setTitle |
177 | * |
178 | * @access public |
179 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
180 | * @param string title |
181 | */ |
182 | public function setTitle($title) |
183 | { |
184 | $this->title = $title; |
185 | } |
186 | |
187 | /** |
188 | * Short description of method getBody |
189 | * |
190 | * @access public |
191 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
192 | * @return string |
193 | */ |
194 | public function getBody() |
195 | { |
196 | return (string) $this->body; |
197 | } |
198 | |
199 | /** |
200 | * Short description of method setBody |
201 | * |
202 | * @access public |
203 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
204 | * @param string body |
205 | * @return mixed |
206 | */ |
207 | public function setBody($body) |
208 | { |
209 | $this->body = $body; |
210 | } |
211 | |
212 | /** |
213 | * Short description of method getStatus |
214 | * |
215 | * @access public |
216 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
217 | * @return int |
218 | */ |
219 | public function getStatus() |
220 | { |
221 | return (int) $this->status; |
222 | } |
223 | |
224 | /** |
225 | * Short description of method setStatus |
226 | * |
227 | * @access public |
228 | * @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu> |
229 | * @param int status |
230 | * @return mixed |
231 | */ |
232 | public function setStatus($status) |
233 | { |
234 | $this->status = $status; |
235 | } |
236 | } |