1 | <?php |
||
13 | final class Event extends Component |
||
14 | { |
||
15 | /** @var array */ |
||
16 | private $alerts = []; |
||
17 | |||
18 | /** @var \DateTimeInterface */ |
||
19 | private $starts; |
||
20 | |||
21 | /** @var \DateTimeInterface */ |
||
22 | private $ends; |
||
23 | |||
24 | /** @var string */ |
||
25 | private $name; |
||
26 | |||
27 | /** @var string|null */ |
||
28 | private $description; |
||
29 | |||
30 | /** @var string|null */ |
||
31 | private $address; |
||
32 | |||
33 | /** @var string|null */ |
||
34 | private $addressName; |
||
35 | |||
36 | /** @var float|null */ |
||
37 | private $lat; |
||
38 | |||
39 | /** @var float|null */ |
||
40 | private $lng; |
||
41 | |||
42 | /** @var string */ |
||
43 | private $uuid; |
||
44 | |||
45 | /** @var \DateTimeInterface */ |
||
46 | private $created; |
||
47 | |||
48 | /** @var bool */ |
||
49 | private $withTimezone = false; |
||
50 | |||
51 | /** @var bool */ |
||
52 | private $isFullDay = false; |
||
53 | |||
54 | public static function create(string $name = null): Event |
||
58 | |||
59 | public function __construct(string $name = null) |
||
65 | |||
66 | public function getComponentType(): string |
||
70 | |||
71 | public function getRequiredProperties(): array |
||
79 | |||
80 | public function startsAt(DateTimeInterface $starts): Event |
||
86 | |||
87 | public function endsAt(DateTimeInterface $ends): Event |
||
93 | |||
94 | public function period(DateTimeInterface $starts, DateTimeInterface $ends): Event |
||
101 | |||
102 | public function name(string $name): Event |
||
108 | |||
109 | public function description(string $description): Event |
||
115 | |||
116 | public function address(string $address, string $name = null): Event |
||
126 | |||
127 | public function addressName(string $name): Event |
||
133 | |||
134 | public function coordinates(float $lat, float $lng): Event |
||
141 | |||
142 | public function uniqueIdentifier(string $uid): Event |
||
148 | |||
149 | public function createdAt(DateTimeInterface $created): Event |
||
155 | |||
156 | public function withTimezone(): Event |
||
162 | |||
163 | public function fullDay(): Event |
||
169 | |||
170 | public function alert(Alert $alert): Event |
||
176 | |||
177 | public function alertMinutesBefore(int $minutes, string $message = null): Event |
||
183 | |||
184 | public function alertMinutesAfter(int $minutes, string $message = null): Event |
||
190 | |||
191 | protected function payload(): ComponentPayload |
||
207 | |||
208 | private function resolveLocationProperties(ComponentPayload $payload): ComponentPayload |
||
233 | } |
||
234 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: