ICalendarEventBuilder
in
The calendar event builder can be used to conveniently build a calendar event and then serialize it to a ICS string. The ICS string can be submitted to calendar instances implementing the {@see \OCP\Calendar\ICreateFromString} interface.
Also note this class can not be injected directly with dependency injection. Instead, inject IManager and use IManager::createEventBuilder() afterwards.
All setters return self to allow chaining method calls.
Tags
Table of Contents
Methods
- addAttendee() : self
- Add a new attendee to the event.
- createInCalendar() : string
- Create the event in the given calendar.
- setDescription() : self
- Set the event description.
- setEndDate() : self
- Set the end date, time and time zone.
- setLocation() : self
- Set the event location. It can either be a physical address or a URL.
- setOrganizer() : self
- Set the event organizer.
- setStartDate() : self
- Set the start date, time and time zone.
- setSummary() : self
- Set the event summary or title.
- toIcs() : string
- Serialize the built event to an ICS string if all required properties set.
Methods
addAttendee()
Add a new attendee to the event.
public
addAttendee(string $email[, string|null $commonName = null ]) : self
Adding at least one attendee requires also setting the organizer!
The "mailto:" prefix is optional and will be added automatically if it is missing.
Parameters
- $email : string
- $commonName : string|null = null
Tags
Return values
selfcreateInCalendar()
Create the event in the given calendar.
public
createInCalendar(ICreateFromString $calendar) : string
Parameters
- $calendar : ICreateFromString
Tags
Return values
string —The filename of the created event
setDescription()
Set the event description.
public
setDescription(string $description) : self
Parameters
- $description : string
Tags
Return values
selfsetEndDate()
Set the end date, time and time zone.
public
setEndDate(DateTimeInterface $end) : self
This property is required!
Parameters
- $end : DateTimeInterface
Tags
Return values
selfsetLocation()
Set the event location. It can either be a physical address or a URL.
public
setLocation(string $location) : self
Parameters
- $location : string
Tags
Return values
selfsetOrganizer()
Set the event organizer.
public
setOrganizer(string $email[, string|null $commonName = null ]) : self
This property is required if attendees are added!
The "mailto:" prefix is optional and will be added automatically if it is missing.
Parameters
- $email : string
- $commonName : string|null = null
Tags
Return values
selfsetStartDate()
Set the start date, time and time zone.
public
setStartDate(DateTimeInterface $start) : self
This property is required!
Parameters
- $start : DateTimeInterface
Tags
Return values
selfsetSummary()
Set the event summary or title.
public
setSummary(string $summary) : self
This property is required!
Parameters
- $summary : string
Tags
Return values
selftoIcs()
Serialize the built event to an ICS string if all required properties set.
public
toIcs() : string
Tags
Return values
string —The serialized ICS string