1 | <?php |
||
48 | class Selector implements SelectorInterface |
||
49 | { |
||
50 | /** |
||
51 | * Year component |
||
52 | * |
||
53 | * @var int |
||
54 | */ |
||
55 | protected $year = null; |
||
56 | /** |
||
57 | * Month component |
||
58 | * |
||
59 | * @var int |
||
60 | */ |
||
61 | protected $month = null; |
||
62 | /** |
||
63 | * Day component |
||
64 | * |
||
65 | * @var int |
||
66 | */ |
||
67 | protected $day = null; |
||
68 | /** |
||
69 | * Hour component |
||
70 | * |
||
71 | * @var int |
||
72 | */ |
||
73 | protected $hour = null; |
||
74 | /** |
||
75 | * Minute component |
||
76 | * |
||
77 | * @var int |
||
78 | */ |
||
79 | protected $minute = null; |
||
80 | /** |
||
81 | * Second component |
||
82 | * |
||
83 | * @var int |
||
84 | */ |
||
85 | protected $second = null; |
||
86 | /** |
||
87 | * Object ID |
||
88 | * |
||
89 | * @var int|string |
||
90 | */ |
||
91 | protected $uid = null; |
||
92 | /** |
||
93 | * Object type |
||
94 | * |
||
95 | * @var string |
||
96 | */ |
||
97 | protected $type = null; |
||
98 | /** |
||
99 | * Revision component |
||
100 | * |
||
101 | * @var int |
||
102 | */ |
||
103 | protected $revision = null; |
||
104 | /** |
||
105 | * Object visibility |
||
106 | * |
||
107 | * @var int |
||
108 | */ |
||
109 | protected $visibility = SelectorInterface::VISIBLE; |
||
110 | /** |
||
111 | * Object draft |
||
112 | * |
||
113 | * @var int |
||
114 | */ |
||
115 | protected $draft = SelectorInterface::PUBLISHED; |
||
116 | |||
117 | /** |
||
118 | * Repository selector constructor |
||
119 | * |
||
120 | * @param TypeServiceInterface $typeService Type Service |
||
121 | * @param string|int|NULL $year Year |
||
122 | * @param string|int|NULL $month Month |
||
123 | * @param string|int|NULL $day Day |
||
124 | * @param string|int|NULL $hour Hour |
||
125 | * @param string|int|NULL $minute Minute |
||
126 | * @param string|int|NULL $second Second |
||
127 | * @param string|int|NULL $uid Object ID |
||
128 | * @param string|NULL $type Object type |
||
129 | * @param int|NULL $revision Revision |
||
130 | * @param int $visibility Visibility |
||
131 | * @param int $draft Draft state |
||
132 | * @throws InvalidArgumentException If any of the components isn't valid |
||
133 | */ |
||
134 | 45 | public function __construct( |
|
248 | |||
249 | /** |
||
250 | * Test if the given argument is a valid object visibility |
||
251 | * |
||
252 | * @param int $visibility Object visibility |
||
253 | * @return boolean Valid visibility |
||
254 | */ |
||
255 | 72 | public static function isValidVisibility($visibility) |
|
261 | |||
262 | /** |
||
263 | * Test if the given argument is a valid object draft state |
||
264 | * |
||
265 | * @param int $draft Object draft state |
||
266 | * @return boolean Valid draft state |
||
267 | */ |
||
268 | 40 | public static function isValidDraftState($draft) |
|
274 | |||
275 | /** |
||
276 | * Return the year component |
||
277 | * |
||
278 | * @return int Year component |
||
279 | */ |
||
280 | 40 | public function getYear() |
|
284 | |||
285 | /** |
||
286 | * Return the month component |
||
287 | * |
||
288 | * @return int Month component |
||
289 | */ |
||
290 | 40 | public function getMonth() |
|
294 | |||
295 | /** |
||
296 | * Return the day component |
||
297 | * |
||
298 | * @return int Day component |
||
299 | */ |
||
300 | 40 | public function getDay() |
|
304 | |||
305 | /** |
||
306 | * Return the hour component |
||
307 | * |
||
308 | * @return int Hour component |
||
309 | */ |
||
310 | 7 | public function getHour() |
|
314 | |||
315 | /** |
||
316 | * Return the minute component |
||
317 | * |
||
318 | * @return int |
||
319 | */ |
||
320 | 7 | public function getMinute() |
|
324 | |||
325 | /** |
||
326 | * Return the second component |
||
327 | * |
||
328 | * @return int |
||
329 | */ |
||
330 | 7 | public function getSecond() |
|
334 | |||
335 | /** |
||
336 | * Return the ID component |
||
337 | * |
||
338 | * @return int ID component |
||
339 | */ |
||
340 | 40 | public function getId() |
|
344 | |||
345 | /** |
||
346 | * Return the Type component |
||
347 | * |
||
348 | * @return string |
||
349 | */ |
||
350 | 40 | public function getType() |
|
354 | |||
355 | /** |
||
356 | * Return the revision component |
||
357 | * |
||
358 | * @return int Revision component |
||
359 | */ |
||
360 | 40 | public function getRevision() |
|
364 | |||
365 | /** |
||
366 | * Return the object visibility |
||
367 | * |
||
368 | * @return int Object visibility |
||
369 | */ |
||
370 | 40 | public function getVisibility() |
|
374 | |||
375 | /** |
||
376 | * Return the object draft state |
||
377 | * |
||
378 | * @return int Object draft state |
||
379 | */ |
||
380 | 33 | public function getDraft() |
|
384 | } |
||
385 |