Skip to content

參與者與提醒 ​

Event、Todo 與 Journal 都可取得主辦人和參與者;Event 與 Todo 另提供提醒。

Organizer ​

Organizer 代表一個 ORGANIZER property。

欄位或方法型別說明
addressstring原始 cal-address;存在時包含 mailto:。
email?string移除 mailto: 前綴後的地址;沒有此前綴時為 null,比對不區分大小寫。
name?stringCN parameter。
sentBy?stringSENT-BY parameter。
directory?stringDIR parameter。
parameters()array<string,string|list<string>>包含未知值在內的全部 parameters。

Attendee ​

Attendee 代表一個可重複的 ATTENDEE property,不會依 address 合併。

欄位或方法型別說明
addressstring原始 cal-address。
email, name?string移除 mailto: 後的地址與 CN 顯示名稱。
role, status, type?string大寫 ROLE、PARTSTAT、CUTYPE。
rsvp?boolTRUE、FALSE;缺少或無法識別時為 null。
delegatedFrom, delegatedToCollection<int,string>委派來源與對象的完整地址清單。
parameters()array<string,string|list<string>>包含未知值在內的全部 parameters。

Alarm 與 trigger ​

每個 Alarm 代表 Event 或 Todo 裡的一個 VALARM。

欄位或方法型別說明
action?stringACTION。
trigger?AlarmTrigger相對或絕對 TRIGGER。
description, summary?string提醒文字。
attendeesCollection<int, Attendee>依原始順序保留的提醒參與者。
attachmentsCollection<int, Property>依原始順序保留的重複 ATTACH properties。
repeat?intREPEAT 次數。
duration?DateInterval每次重複之間的時間。
properties(), property(), hasProperty()Collection / ?Property / bool查詢直接屬性,或判斷屬性是否存在。
rawComponent()VAlarm底層的 alarm component。
php
$trigger = $event->alarms->first()?->trigger;

$trigger?->isRelative(); // ?bool
$trigger?->isAbsolute(); // ?bool
$trigger?->duration();   // ?DateInterval
$trigger?->dateTime();   // ?CarbonImmutable
$trigger?->relatedTo();  // START、END 或 null

相對提醒的 duration() 表示距離事件或待辦開始/結束時間的偏移量,relatedTo() 指定以哪個時間為準。絕對提醒則由 dateTime() 提供確切時間。需要值與參數時可用 property('TRIGGER');需要完整提醒資料時可用 rawComponent()。

Last updated:

使用 MIT License 發佈。