1 | <?php |
||
48 | class Selector implements SelectorInterface |
||
49 | { |
||
50 | /** |
||
51 | * Year component |
||
52 | * |
||
53 | * @var int |
||
54 | */ |
||
55 | private $year = null; |
||
56 | /** |
||
57 | * Month component |
||
58 | * |
||
59 | * @var int |
||
60 | */ |
||
61 | private $month = null; |
||
62 | /** |
||
63 | * Day component |
||
64 | * |
||
65 | * @var int |
||
66 | */ |
||
67 | private $day = null; |
||
68 | /** |
||
69 | * Hour component |
||
70 | * |
||
71 | * @var int |
||
72 | */ |
||
73 | private $hour = null; |
||
74 | /** |
||
75 | * Minute component |
||
76 | * |
||
77 | * @var int |
||
78 | */ |
||
79 | private $minute = null; |
||
80 | /** |
||
81 | * Second component |
||
82 | * |
||
83 | * @var int |
||
84 | */ |
||
85 | private $second = null; |
||
86 | /** |
||
87 | * Object ID |
||
88 | * |
||
89 | * @var int|string |
||
90 | */ |
||
91 | private $uid = null; |
||
92 | /** |
||
93 | * Object type |
||
94 | * |
||
95 | * @var string |
||
96 | */ |
||
97 | private $type = null; |
||
98 | /** |
||
99 | * Revision component |
||
100 | * |
||
101 | * @var int |
||
102 | */ |
||
103 | private $revision = null; |
||
104 | /** |
||
105 | * Object visibility |
||
106 | * |
||
107 | * @var int |
||
108 | */ |
||
109 | private $visibility = SelectorInterface::VISIBLE; |
||
110 | |||
111 | /** |
||
112 | * Repository selector constructor |
||
113 | * |
||
114 | * @param string|int|NULL $year |
||
115 | * @param string|int|NULL $month |
||
116 | * @param string|int|NULL $day |
||
117 | * @param string|int|NULL $hour |
||
118 | * @param string|int|NULL $minute |
||
119 | * @param string|int|NULL $second |
||
120 | * @param string|int|NULL $uid Object ID |
||
121 | * @param string|NULL $type Object type |
||
122 | * @param int|NULL $revision |
||
123 | * @param int $visibility |
||
124 | * @throws InvalidArgumentException If any of the components isn't valid |
||
125 | */ |
||
126 | 16 | public function __construct( |
|
224 | |||
225 | /** |
||
226 | * Return the year component |
||
227 | * |
||
228 | * @return int Year component |
||
229 | */ |
||
230 | 10 | public function getYear() |
|
234 | |||
235 | /** |
||
236 | * Return the month component |
||
237 | * |
||
238 | * @return int Month component |
||
239 | */ |
||
240 | 10 | public function getMonth() |
|
244 | |||
245 | /** |
||
246 | * Return the day component |
||
247 | * |
||
248 | * @return int Day component |
||
249 | */ |
||
250 | 10 | public function getDay() |
|
254 | |||
255 | /** |
||
256 | * Return the hour component |
||
257 | * |
||
258 | * @return int Hour component |
||
259 | */ |
||
260 | 10 | public function getHour() |
|
264 | |||
265 | /** |
||
266 | * Return the minute component |
||
267 | * |
||
268 | * @return int |
||
269 | */ |
||
270 | 10 | public function getMinute() |
|
274 | |||
275 | /** |
||
276 | * Return the second component |
||
277 | * |
||
278 | * @return int |
||
279 | */ |
||
280 | 10 | public function getSecond() |
|
284 | |||
285 | /** |
||
286 | * Return the ID component |
||
287 | * |
||
288 | * @return int ID component |
||
289 | */ |
||
290 | 10 | public function getId() |
|
294 | |||
295 | /** |
||
296 | * Return the Type component |
||
297 | * |
||
298 | * @return string |
||
299 | */ |
||
300 | 10 | public function getType() |
|
304 | |||
305 | /** |
||
306 | * Return the revision component |
||
307 | * |
||
308 | * @return int Revision component |
||
309 | */ |
||
310 | 10 | public function getRevision() |
|
314 | |||
315 | /** |
||
316 | * Return the object visibility |
||
317 | * |
||
318 | * @return int Object visibility |
||
319 | */ |
||
320 | 10 | public function getVisibility() |
|
324 | |||
325 | /** |
||
326 | * Test if the given argument is a valid object visibility |
||
327 | * |
||
328 | * @param int $visibility Object visibility |
||
329 | * @return boolean Valid visibility |
||
330 | */ |
||
331 | 12 | public static function isValidVisibility($visibility) |
|
337 | } |
||
338 |