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