5585baf717f83f4d33b0646a05d617a7ddc9157b
[Packages/TYPO3.CMS.git] / typo3 / sysext / belog / Classes / Domain / Model / Constraint.php
1 <?php
2 namespace TYPO3\CMS\Belog\Domain\Model;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Constraints for log entries
19 */
20 class Constraint extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
21 {
22 /**
23 * Selected user/group; possible values are "gr-<uid>" for a group, "us-<uid>" for a user or -1 for "all users"
24 *
25 * @var string
26 */
27 protected $userOrGroup = '0';
28
29 /**
30 * Number of log rows to show
31 *
32 * @var int
33 */
34 protected $number = 20;
35
36 /**
37 * UID of selected workspace
38 *
39 * @var int
40 */
41 protected $workspaceUid = \TYPO3\CMS\Belog\Domain\Model\Workspace::UID_ANY_WORKSPACE;
42
43 /**
44 * Selected time frame
45 *
46 * @var int
47 */
48 protected $timeFrame = 0;
49
50 /**
51 * Selected action
52 *
53 * @var int
54 */
55 protected $action = 0;
56
57 /**
58 * Whether rows should be grouped by page
59 *
60 * @var bool
61 */
62 protected $groupByPage = false;
63
64 /**
65 * Calculated start timestamp
66 *
67 * @var int
68 */
69 protected $startTimestamp = 0;
70
71 /**
72 * Calculated end timestamp
73 *
74 * @var int
75 */
76 protected $endTimestamp = 0;
77
78 /**
79 * Manual date start
80 * @var \DateTime
81 */
82 protected $manualDateStart;
83
84 /**
85 * Manual date stop
86 * @var \DateTime
87 */
88 protected $manualDateStop;
89
90 /**
91 * Whether the plugin is called in page context (submodule of Web > Info)
92 *
93 * @var bool
94 */
95 protected $isInPageContext = false;
96
97 /**
98 * Selected page ID in page context
99 *
100 * @var int
101 */
102 protected $pageId = 0;
103
104 /**
105 * Page level depth
106 *
107 * @var int
108 */
109 protected $depth = 0;
110
111 /**
112 * Default constructor
113 */
114 public function __construct()
115 {
116 }
117
118 /**
119 * added to prevent the deprecation message
120 * in Extbase\DomainObject\AbstractDomainObject
121 *
122 * @todo the constraints model needs another way of storing
123 * persisted search data than serialisation
124 */
125 public function __wakeup()
126 {
127 }
128
129 /**
130 * Set user
131 *
132 * @param string $user
133 */
134 public function setUserOrGroup($user)
135 {
136 $this->userOrGroup = $user;
137 }
138
139 /**
140 * Get user
141 *
142 * @return string
143 */
144 public function getUserOrGroup()
145 {
146 return $this->userOrGroup;
147 }
148
149 /**
150 * Set number of log rows to show
151 *
152 * @param int $number
153 */
154 public function setNumber($number)
155 {
156 $this->number = (int)$number;
157 }
158
159 /**
160 * Get number of log entries to show
161 *
162 * @return int
163 */
164 public function getNumber()
165 {
166 return $this->number;
167 }
168
169 /**
170 * Set workspace
171 *
172 * @param string $workspace
173 */
174 public function setWorkspaceUid($workspace)
175 {
176 $this->workspaceUid = $workspace;
177 }
178
179 /**
180 * Get workspace
181 *
182 * @return string
183 */
184 public function getWorkspaceUid()
185 {
186 return $this->workspaceUid;
187 }
188
189 /**
190 * Set time frame
191 *
192 * @param int $timeFrame
193 */
194 public function setTimeFrame($timeFrame)
195 {
196 $this->timeFrame = $timeFrame;
197 }
198
199 /**
200 * Get time frame
201 *
202 * @return int
203 */
204 public function getTimeFrame()
205 {
206 return (int)$this->timeFrame;
207 }
208
209 /**
210 * Set action
211 *
212 * @param int $action
213 */
214 public function setAction($action)
215 {
216 $this->action = $action;
217 }
218
219 /**
220 * Get action
221 *
222 * @return int
223 */
224 public function getAction()
225 {
226 return (int)$this->action;
227 }
228
229 /**
230 * Set group by page
231 *
232 * @param bool $groupByPage
233 */
234 public function setGroupByPage($groupByPage)
235 {
236 $this->groupByPage = $groupByPage;
237 }
238
239 /**
240 * Get group by page
241 *
242 * @return bool
243 */
244 public function getGroupByPage()
245 {
246 return (bool)$this->groupByPage;
247 }
248
249 /**
250 * Set calculated start timestamp from query constraints
251 *
252 * @param int $timestamp
253 */
254 public function setStartTimestamp($timestamp)
255 {
256 $this->startTimestamp = (int)$timestamp;
257 }
258
259 /**
260 * Get calculated start timestamp from query constraints
261 *
262 * @return int
263 */
264 public function getStartTimestamp()
265 {
266 return $this->startTimestamp;
267 }
268
269 /**
270 * Set calculated end timestamp from query constraints
271 *
272 * @param int $timestamp
273 */
274 public function setEndTimestamp($timestamp)
275 {
276 $this->endTimestamp = (int)$timestamp;
277 }
278
279 /**
280 * Get calculated end timestamp from query constraints
281 *
282 * @return int
283 */
284 public function getEndTimestamp()
285 {
286 return $this->endTimestamp;
287 }
288
289 /**
290 * Set page context
291 *
292 * @param bool $pageContext
293 */
294 public function setIsInPageContext($pageContext)
295 {
296 $this->isInPageContext = $pageContext;
297 }
298
299 /**
300 * Get page context
301 *
302 * @return bool
303 */
304 public function getIsInPageContext()
305 {
306 return (bool)$this->isInPageContext;
307 }
308
309 /**
310 * Set page id
311 *
312 * @param int $id
313 */
314 public function setPageId($id)
315 {
316 $this->pageId = (int)$id;
317 }
318
319 /**
320 * Get page id
321 *
322 * @return int
323 */
324 public function getPageId()
325 {
326 return $this->pageId;
327 }
328
329 /**
330 * Set page level depth
331 *
332 * @param int $depth
333 */
334 public function setDepth($depth)
335 {
336 $this->depth = $depth;
337 }
338
339 /**
340 * Get page level depth
341 *
342 * @return int
343 */
344 public function getDepth()
345 {
346 return (int)$this->depth;
347 }
348
349 /**
350 * Set manual date start
351 *
352 * @param \DateTime $manualDateStart
353 */
354 public function setManualDateStart(\DateTime $manualDateStart = null)
355 {
356 $this->manualDateStart = $manualDateStart;
357 }
358
359 /**
360 * Get manual date start
361 *
362 * @return \DateTime
363 */
364 public function getManualDateStart()
365 {
366 return $this->manualDateStart;
367 }
368
369 /**
370 * Set manual date stop
371 *
372 * @param \DateTime $manualDateStop
373 */
374 public function setManualDateStop(\DateTime $manualDateStop = null)
375 {
376 $this->manualDateStop = $manualDateStop;
377 }
378
379 /**
380 * Get manual date stop
381 *
382 * @return \DateTime
383 */
384 public function getManualDateStop()
385 {
386 return $this->manualDateStop;
387 }
388 }