Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/calendar/lib/ical/basic/ |
Upload File : |
<?php namespace Bitrix\Calendar\ICal\Basic; use Bitrix\Main\Type\Date; class Content { private $type; private $properties = []; private $subComponents = []; public static function getInstance(string $type): Content { return new self($type); } public function __construct(string $type) { $this->type = $type; } public function property(PropertyType $property, array $parameters = null): Content { $property->addParameters($parameters ?? []); $this->properties[] = $property; return $this; } public function dateTimeProperty( $names, Date $value, bool $withTime = false, bool $withTimeZone = false, bool $isUTC = false ): Content { if ($value === null) { return $this; } return $this->property(new DateTimePropertyType($names, $value, $withTime, $withTimeZone, $isUTC)); } public function textProperty($names, ?string $value, bool $disableEscaping = false) : Content { if ($value === null) { return $this; } return $this->property(new TextPropertyType($names, $value, $disableEscaping)); } public function timezoneOffsetProperty( $names, \DateTimeZone $value ): Content { if ($value === null) { return $this; } return $this->property(new DateTimePropertyType($names, $value)); } public function subComponent(BasicComponent ...$components) : Content { foreach ($components as $component) { $this->subComponents[] = $component; } return $this; } public function getType() : string { return $this->type; } public function getProperties() : array { return $this->properties; } public function getSubComponents() : array { return $this->subComponents; } }