From 96ba17ebfe9c04fbd36e06cc291b9771ef0a38bd Mon Sep 17 00:00:00 2001 From: Kyle Milloy Date: Mon, 7 Oct 2024 17:41:59 -0600 Subject: [PATCH] chore: add ability to add organizer --- src/NowCal/NowCal.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/NowCal/NowCal.php b/src/NowCal/NowCal.php index bb45a41..d5406b3 100644 --- a/src/NowCal/NowCal.php +++ b/src/NowCal/NowCal.php @@ -48,7 +48,8 @@ class NowCal 'duration', 'sequence', 'timezone', - 'reminder' + 'reminder', + 'organizer', ]; /** @@ -191,6 +192,13 @@ class NowCal */ public ?string $reminder = null; + /** + * The reminder for the event. + * + * @see https://www.rfc-editor.org/rfc/rfc5545#section-3.8.4.3 + */ + public ?string $organizer = null; + /** * Instantiate the NowCal class. */ @@ -364,6 +372,13 @@ public function reminder(string|DateInterval|Closure $reminder): self return $this; } + public function organizer(string $organizer): self + { + $this->set('organizer', $organizer); + + return $this; + } + /** * Check if the key is allowed to be set. */ @@ -637,6 +652,15 @@ protected function createReminder(): void $this->output[] = 'END:VALARM'; } + protected function createOrganizer(): void + { + if (!$this->organizer) { + return; + } + + $this->output[] = 'ORGANIZER;CN=' . $this->organizer; + } + /** * Get the provided parameter from the ICS spec. If not * included in the spec then fail. If not provided but