1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
calendar.php
См. документацию.
1<?php
2
3
5
6
8{
9 public const COMPONENT_TYPE = 'VCALENDAR';
13 private $events = [];
17 private $timezones = [];
21 private $name;
25 private $productIdentifier;
29 private $method;
33 private $version;
37 private $calScale;
38
43 public static function createInstance(string $name = ''): Calendar
44 {
45 return new self($name);
46 }
47
52 public function __construct($name)
53 {
54 $this->name = $name;
55 }
56
60 public function getType(): string
61 {
62 return self::COMPONENT_TYPE;
63 }
64
68 public function getProperties(): array
69 {
70 return [];
71 }
72
77 public function setMethod(?ParserPropertyType $method): Calendar
78 {
79 $this->method = $method;
80
81 return $this;
82 }
83
88 public function setProdId(?ParserPropertyType $prodId): Calendar
89 {
90 $this->productIdentifier = $prodId;
91
92 return $this;
93 }
94
99 public function setCalScale(?ParserPropertyType $calscale): Calendar
100 {
101 $this->calScale = $calscale;
102
103 return $this;
104 }
105
110 public function setVersion(?ParserPropertyType $version): Calendar
111 {
112 $this->version = $version;
113
114 return $this;
115 }
116
121 public function setEvent(Event $event): Calendar
122 {
123 $this->events[] = $event;
124
125 return $this;
126 }
127
132 public function setSubComponents(iterable $subComponents): Calendar
133 {
134 foreach ($subComponents as $subComponent)
135 {
136 if ($subComponent instanceof ParserComponent)
137 {
138 if ($subComponent instanceof Event)
139 {
140 $this->events[] = $subComponent;
141 }
142 elseif($subComponent instanceof Timezone)
143 {
144 $this->timezones[] = $subComponent;
145 }
146 }
147 }
148
149 return $this;
150 }
151
155 public function getContent(): Calendar
156 {
157 return $this;
158 }
159
163 public function getEvents(): array
164 {
165 return $this->events;
166 }
167
171 public function getProdId(): ?string
172 {
173 if ($this->productIdentifier instanceof ParserPropertyType)
174 {
175 return $this->productIdentifier->getValue();
176 }
177
178 return null;
179 }
180
184 public function getVersion(): ?string
185 {
186 if ($this->version instanceof ParserPropertyType)
187 {
188 return $this->version->getValue();
189 }
190
191 return null;
192 }
193
197 public function getTimezones(): array
198 {
199 return $this->timezones;
200 }
201
205 public function getMethod(): ?string
206 {
207 if ($this->method instanceof ParserPropertyType)
208 {
209 return $this->method->getValue();
210 }
211
212 return null;
213 }
214
218 public function getCalScale(): ?ParserPropertyType
219 {
220 return $this->calScale;
221 }
222
226 public function countEvents(): int
227 {
228 return count($this->events);
229 }
230
234 public function getName(): string
235 {
236 return $this->name;
237 }
238
242 public function hasOneEvent(): bool
243 {
244 return $this->countEvents() === 1;
245 }
246
250 public function getEvent(): Event
251 {
252 return $this->events[0];
253 }
254}
xml version
Определения yandex.php:67
setProdId(?ParserPropertyType $prodId)
Определения calendar.php:88
setVersion(?ParserPropertyType $version)
Определения calendar.php:110
setSubComponents(iterable $subComponents)
Определения calendar.php:132
static createInstance(string $name='')
Определения calendar.php:43
setEvent(Event $event)
Определения calendar.php:121
setCalScale(?ParserPropertyType $calscale)
Определения calendar.php:99
setMethod(?ParserPropertyType $method)
Определения calendar.php:77
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936