1 | <?php |
||
15 | final class Event extends Component |
||
16 | { |
||
17 | /** @var array */ |
||
18 | private $alerts = []; |
||
19 | |||
20 | /** @var \DateTimeInterface */ |
||
21 | private $starts; |
||
22 | |||
23 | /** @var \DateTimeInterface */ |
||
24 | private $ends; |
||
25 | |||
26 | /** @var string */ |
||
27 | private $name; |
||
28 | |||
29 | /** @var string|null */ |
||
30 | private $description; |
||
31 | |||
32 | /** @var string|null */ |
||
33 | private $address; |
||
34 | |||
35 | /** @var string|null */ |
||
36 | private $addressName; |
||
37 | |||
38 | /** @var float|null */ |
||
39 | private $lat; |
||
40 | |||
41 | /** @var float|null */ |
||
42 | private $lng; |
||
43 | |||
44 | /** @var string */ |
||
45 | private $uuid; |
||
46 | |||
47 | /** @var \DateTimeInterface */ |
||
48 | private $created; |
||
49 | |||
50 | /** @var bool */ |
||
51 | private $withTimezone = false; |
||
52 | |||
53 | /** @var bool */ |
||
54 | private $isFullDay = false; |
||
55 | |||
56 | /** @var \Spatie\IcalendarGenerator\Enums\Classification|null */ |
||
57 | private $classification = null; |
||
58 | |||
59 | /** @var bool|null */ |
||
60 | private $transparent = null; |
||
61 | |||
62 | /** @var \Spatie\IcalendarGenerator\ValueObjects\CalendarAddress[] */ |
||
63 | private $attendees = []; |
||
64 | |||
65 | /** @var \Spatie\IcalendarGenerator\ValueObjects\CalendarAddress|null */ |
||
66 | private $organizer = null; |
||
67 | |||
68 | public static function create(string $name = null): Event |
||
72 | |||
73 | public function __construct(string $name = null) |
||
79 | |||
80 | public function getComponentType(): string |
||
84 | |||
85 | public function getRequiredProperties(): array |
||
93 | |||
94 | public function startsAt(DateTimeInterface $starts): Event |
||
100 | |||
101 | public function endsAt(DateTimeInterface $ends): Event |
||
107 | |||
108 | public function period(DateTimeInterface $starts, DateTimeInterface $ends): Event |
||
115 | |||
116 | public function name(string $name): Event |
||
122 | |||
123 | public function description(string $description): Event |
||
129 | |||
130 | public function address(string $address, string $name = null): Event |
||
140 | |||
141 | public function addressName(string $name): Event |
||
147 | |||
148 | public function coordinates(float $lat, float $lng): Event |
||
155 | |||
156 | public function uniqueIdentifier(string $uid): Event |
||
162 | |||
163 | public function createdAt(DateTimeInterface $created): Event |
||
169 | |||
170 | public function withTimezone(): Event |
||
176 | |||
177 | public function fullDay(): Event |
||
183 | |||
184 | public function alert(Alert $alert): Event |
||
190 | |||
191 | public function alertMinutesBefore(int $minutes, string $message = null): Event |
||
197 | |||
198 | public function alertMinutesAfter(int $minutes, string $message = null): Event |
||
204 | |||
205 | public function classification(?Classification $classification): Event |
||
211 | |||
212 | public function transparent(): Event |
||
218 | |||
219 | public function attendee( |
||
228 | |||
229 | public function organizer(string $email, string $name = null): Event |
||
235 | |||
236 | protected function payload(): ComponentPayload |
||
262 | |||
263 | private function resolveLocationProperties(ComponentPayload $payload): ComponentPayload |
||
288 | } |
||
289 |
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: