annotate vendor/sabre/vobject/lib/Component/VTimeZone.php @ 38:ac106d4c8961 default tip

flip /etc/roundcube to point here
author Charlie Root
date Sat, 29 Dec 2018 05:39:53 -0500
parents 430dbd5346f7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject\Component;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 use Sabre\VObject;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8 * The VTimeZone component
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10 * This component adds functionality to a component, specific for VTIMEZONE
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11 * components.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13 * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14 * @author Evert Pot (http://evertpot.com/)
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15 * @license http://sabre.io/license/ Modified BSD License
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17 class VTimeZone extends VObject\Component {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 * Returns the PHP DateTimeZone for this VTIMEZONE component.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22 * If we can't accurately determine the timezone, this method will return
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23 * UTC.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25 * @return \DateTimeZone
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27 function getTimeZone() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29 return VObject\TimeZoneUtil::getTimeZone((string)$this->TZID, $this->root);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
31 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
32
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
33 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
34 * A simple list of validation rules.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
35 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
36 * This is simply a list of properties, and how many times they either
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
37 * must or must not appear.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
38 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
39 * Possible values per property:
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
40 * * 0 - Must not appear.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
41 * * 1 - Must appear exactly once.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
42 * * + - Must appear at least once.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
43 * * * - Can appear any number of times.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
44 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
45 * @var array
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
46 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
47 function getValidationRules() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
48
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
49 return array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
50 'TZID' => 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
51
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
52 'LAST-MODIFICATION' => '?',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
53 'TZURL' => '?',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
54
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
55 // At least 1 STANDARD or DAYLIGHT must appear, or more. But both
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
56 // cannot appear in the same VTIMEZONE.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
57 //
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
58 // The validator is not specific yet to pick this up, so these
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
59 // rules are too loose.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
60 'STANDARD' => '*',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
61 'DAYLIGHT' => '*',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
62 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
63
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
64 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
65
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
66 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
67