Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
timezone.php
1<?php
2
3
5
6
11use DateTimeZone;
12
14{
15 private $id;
16 private $observances = [];
17
18 public static function createInstance(): Timezone
19 {
20 return new self();
21 }
22
23 public function __construct()
24 {
25 }
26
27 public function getType(): string
28 {
29 return 'VTIMEZONE';
30 }
31
32 public function getProperties(): array
33 {
34 return [
35 'TZID',
36 ];
37 }
38
43 public function setTimezoneId(DateTimeZone $tz): Timezone
44 {
45 $this->id = $tz->getName();
46
47 return $this;
48 }
49
50 public function setObservance(Observance $observance)
51 {
52 $this->observances[] = $observance;
53
54 return $this;
55 }
56
60 public function setContent(): Content
61 {
62 return Content::getInstance($this->getType())
63 ->textProperty('TZID', $this->id)
64 ->subComponent(...$this->observances);
65 }
66}
textProperty($names, ?string $value, bool $disableEscaping=false)
Definition content.php:48
setObservance(Observance $observance)
Definition timezone.php:50