Skip to content

Commit

Permalink
chore: add ability to add organizer
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemilloy committed Oct 7, 2024
1 parent fd7d8f7 commit 96ba17e
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/NowCal/NowCal.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class NowCal
'duration',
'sequence',
'timezone',
'reminder'
'reminder',
'organizer',
];

/**
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 96ba17e

Please sign in to comment.