Available.php
6 months ago
VAlarm.php
6 months ago
VAvailability.php
6 months ago
VCalendar.php
6 months ago
VCard.php
6 months ago
VEvent.php
6 months ago
VFreeBusy.php
6 months ago
VJournal.php
6 months ago
VTimeZone.php
6 months ago
VTodo.php
6 months ago
VTimeZone.php
64 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaVendor\Sabre\VObject\Component; |
| 4 | |
| 5 | use AmeliaVendor\Sabre\VObject; |
| 6 | |
| 7 | /** |
| 8 | * The VTimeZone component. |
| 9 | * |
| 10 | * This component adds functionality to a component, specific for VTIMEZONE |
| 11 | * components. |
| 12 | * |
| 13 | * @copyright Copyright (C) fruux GmbH (https://fruux.com/) |
| 14 | * @author Evert Pot (http://evertpot.com/) |
| 15 | * @license http://sabre.io/license/ Modified BSD License |
| 16 | */ |
| 17 | class VTimeZone extends VObject\Component |
| 18 | { |
| 19 | /** |
| 20 | * Returns the PHP DateTimeZone for this VTIMEZONE component. |
| 21 | * |
| 22 | * If we can't accurately determine the timezone, this method will return |
| 23 | * UTC. |
| 24 | * |
| 25 | * @return \DateTimeZone |
| 26 | */ |
| 27 | public function getTimeZone() |
| 28 | { |
| 29 | return VObject\TimeZoneUtil::getTimeZone((string) $this->TZID, $this->root); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * A simple list of validation rules. |
| 34 | * |
| 35 | * This is simply a list of properties, and how many times they either |
| 36 | * must or must not appear. |
| 37 | * |
| 38 | * Possible values per property: |
| 39 | * * 0 - Must not appear. |
| 40 | * * 1 - Must appear exactly once. |
| 41 | * * + - Must appear at least once. |
| 42 | * * * - Can appear any number of times. |
| 43 | * * ? - May appear, but not more than once. |
| 44 | * |
| 45 | * @var array |
| 46 | */ |
| 47 | public function getValidationRules() |
| 48 | { |
| 49 | return [ |
| 50 | 'TZID' => 1, |
| 51 | |
| 52 | 'LAST-MODIFIED' => '?', |
| 53 | 'TZURL' => '?', |
| 54 | |
| 55 | // At least 1 STANDARD or DAYLIGHT must appear. |
| 56 | // |
| 57 | // The validator is not specific yet to pick this up, so these |
| 58 | // rules are too loose. |
| 59 | 'STANDARD' => '*', |
| 60 | 'DAYLIGHT' => '*', |
| 61 | ]; |
| 62 | } |
| 63 | } |
| 64 |