[TASK] Use view helper to configure ModuleTemplate in log module
[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
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 * Selected page ID in page context
92 *
93 * @var int
94 */
95 protected $pageId = 0;
96
97 /**
98 * Page level depth
99 *
100 * @var int
101 */
102 protected $depth = 0;
103
104 /**
105 * Set user
106 *
107 * @param string $user
108 */
109 public function setUserOrGroup($user)
110 {
111 $this->userOrGroup = $user;
112 }
113
114 /**
115 * Get user
116 *
117 * @return string
118 */
119 public function getUserOrGroup()
120 {
121 return $this->userOrGroup;
122 }
123
124 /**
125 * Set number of log rows to show
126 *
127 * @param int $number
128 */
129 public function setNumber($number)
130 {
131 $this->number = (int)$number;
132 }
133
134 /**
135 * Get number of log entries to show
136 *
137 * @return int
138 */
139 public function getNumber()
140 {
141 return $this->number;
142 }
143
144 /**
145 * Set workspace
146 *
147 * @param string $workspace
148 */
149 public function setWorkspaceUid($workspace)
150 {
151 $this->workspaceUid = $workspace;
152 }
153
154 /**
155 * Get workspace
156 *
157 * @return string
158 */
159 public function getWorkspaceUid()
160 {
161 return $this->workspaceUid;
162 }
163
164 /**
165 * Set time frame
166 *
167 * @param int $timeFrame
168 */
169 public function setTimeFrame($timeFrame)
170 {
171 $this->timeFrame = $timeFrame;
172 }
173
174 /**
175 * Get time frame
176 *
177 * @return int
178 */
179 public function getTimeFrame()
180 {
181 return (int)$this->timeFrame;
182 }
183
184 /**
185 * Set action
186 *
187 * @param int $action
188 */
189 public function setAction($action)
190 {
191 $this->action = $action;
192 }
193
194 /**
195 * Get action
196 *
197 * @return int
198 */
199 public function getAction()
200 {
201 return (int)$this->action;
202 }
203
204 /**
205 * Set group by page
206 *
207 * @param bool $groupByPage
208 */
209 public function setGroupByPage($groupByPage)
210 {
211 $this->groupByPage = $groupByPage;
212 }
213
214 /**
215 * Get group by page
216 *
217 * @return bool
218 */
219 public function getGroupByPage()
220 {
221 return (bool)$this->groupByPage;
222 }
223
224 /**
225 * Set calculated start timestamp from query constraints
226 *
227 * @param int $timestamp
228 */
229 public function setStartTimestamp($timestamp)
230 {
231 $this->startTimestamp = (int)$timestamp;
232 }
233
234 /**
235 * Get calculated start timestamp from query constraints
236 *
237 * @return int
238 */
239 public function getStartTimestamp()
240 {
241 return $this->startTimestamp;
242 }
243
244 /**
245 * Set calculated end timestamp from query constraints
246 *
247 * @param int $timestamp
248 */
249 public function setEndTimestamp($timestamp)
250 {
251 $this->endTimestamp = (int)$timestamp;
252 }
253
254 /**
255 * Get calculated end timestamp from query constraints
256 *
257 * @return int
258 */
259 public function getEndTimestamp()
260 {
261 return $this->endTimestamp;
262 }
263
264 /**
265 * Set page id
266 *
267 * @param int $id
268 */
269 public function setPageId($id)
270 {
271 $this->pageId = (int)$id;
272 }
273
274 /**
275 * Get page id
276 *
277 * @return int
278 */
279 public function getPageId()
280 {
281 return $this->pageId;
282 }
283
284 /**
285 * Set page level depth
286 *
287 * @param int $depth
288 */
289 public function setDepth($depth)
290 {
291 $this->depth = $depth;
292 }
293
294 /**
295 * Get page level depth
296 *
297 * @return int
298 */
299 public function getDepth()
300 {
301 return (int)$this->depth;
302 }
303
304 /**
305 * Set manual date start
306 *
307 * @param \DateTime $manualDateStart
308 */
309 public function setManualDateStart(\DateTime $manualDateStart = null)
310 {
311 $this->manualDateStart = $manualDateStart;
312 }
313
314 /**
315 * Get manual date start
316 *
317 * @return \DateTime
318 */
319 public function getManualDateStart()
320 {
321 return $this->manualDateStart;
322 }
323
324 /**
325 * Set manual date stop
326 *
327 * @param \DateTime $manualDateStop
328 */
329 public function setManualDateStop(\DateTime $manualDateStop = null)
330 {
331 $this->manualDateStop = $manualDateStop;
332 }
333
334 /**
335 * Get manual date stop
336 *
337 * @return \DateTime
338 */
339 public function getManualDateStop()
340 {
341 return $this->manualDateStop;
342 }
343 }