Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
attendeespropertytype.php
1<?php
2
3
5
6
8{
9 private $calendarAddress;
10
11 public static function createInstance($names, AttendeesProperty $calendarAddress): AttendeesPropertyType
12 {
13 return new self($names, $calendarAddress);
14 }
15
16 public function __construct($names, AttendeesProperty $calendarAddress)
17 {
18 parent::__construct($names);
19
20 $this->calendarAddress = $calendarAddress;
21
22 if ($this->calendarAddress->participationStatus)
23 {
24 $this->addParameter(Parameter::getInstance('PARTSTAT', $this->calendarAddress->participationStatus));
25 }
26
27 if ($this->calendarAddress->role)
28 {
29 $this->addParameter(Parameter::getInstance('ROLE', $this->calendarAddress->role));
30 }
31
32 if ($this->calendarAddress->cutype)
33 {
34 $this->addParameter(Parameter::getInstance('CUTYPE', $this->calendarAddress->cutype));
35 }
36
37 if ($this->calendarAddress->rsvp)
38 {
39 $this->addParameter(Parameter::getInstance('RSVP', 'TRUE'));
40 }
41
42
43 if ($this->calendarAddress->name)
44 {
45 $this->addParameter(Parameter::getInstance('CN', trim($this->calendarAddress->name)));
46 }
47
48 if ($this->calendarAddress->email)
49 {
50 $this->addParameter(Parameter::getInstance('EMAIL', trim($this->calendarAddress->email)));
51 }
52 }
53
54 public function getValue(): string
55 {
56 if (!empty($this->calendarAddress->mailto))
57 {
58 return "mailto:{$this->calendarAddress->mailto}";
59 }
60 return "mailto:{$this->calendarAddress->email}";
61 }
62
64 {
65 return $this->calendarAddress;
66 }
67}
__construct($names, AttendeesProperty $calendarAddress)
static createInstance($names, AttendeesProperty $calendarAddress)
static getInstance(string $name, string $value, $disableEscaping=false)
Definition parameter.php:13