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