IManager
in
This class provides access to the Nextcloud CalDAV backend.
Use this class exclusively if you want to access calendars.
Events/Journals/Todos in general will be expressed as an array of key-value-pairs. The keys will match the property names defined in https://tools.ietf.org/html/rfc5545
[ 'id' => 123, 'type' => 'VEVENT', 'calendar-key' => 42, 'objects' => [ [ 'SUMMARY' => ['FooBar', []], 'DTSTART' => ['20171001T123456', ['TZID' => 'EUROPE/BERLIN']], 'DURATION' => ['P1D', []], 'ATTENDEE' => [ ['mailto:bla@blub.com', ['CN' => 'Mr. Bla Blub']] ], 'VALARM' => [ [ 'TRIGGER' => ['19980101T050000Z', ['VALUE' => DATE-TIME]] ] ] ], ] ]
Tags
Table of Contents
Methods
- clear() : void
- removes all registered calendar instances
- getCalendars() : array<string|int, ICalendar>
- getCalendarsForPrincipal() : array<string|int, ICalendar>
- handleIMipCancel() : bool
- Handle a iMip CANCEL message
- handleIMipReply() : bool
- Handle a iMip REPLY message
- handleIMipRequest() : bool
- Handle a iMip REQUEST message
- isEnabled() : bool
- Check if calendars are available
- newQuery() : ICalendarQuery
- Build a new query for searchForPrincipal
- register() : void
- In order to improve lazy loading a closure can be registered which will be called in case calendars are actually requested
- registerCalendar() : void
- Registers a calendar
- search() : array<string|int, mixed>
- This function is used to search and find objects within the user's calendars.
- searchForPrincipal() : array<string|int, array<string|int, mixed>>
- Query a principals calendar(s)
- unregisterCalendar() : void
- Unregisters a calendar
Methods
clear()
removes all registered calendar instances
public
clear() : void
Tags
getCalendars()
public
getCalendars() : array<string|int, ICalendar>
use \OCP\Calendar\IManager::getCalendarsForPrincipal
Tags
Return values
array<string|int, ICalendar>getCalendarsForPrincipal()
public
getCalendarsForPrincipal(string $principalUri[, array<string|int, string> $calendarUris = [] ]) : array<string|int, ICalendar>
Parameters
- $principalUri : string
-
URI of the principal
- $calendarUris : array<string|int, string> = []
-
optionally specify which calendars to load, or all if this array is empty
Tags
Return values
array<string|int, ICalendar>handleIMipCancel()
Handle a iMip CANCEL message
public
handleIMipCancel(string $principalUri, string $sender, string|null $replyTo, string $recipient, string $calendarData) : bool
Parameters
- $principalUri : string
- $sender : string
- $replyTo : string|null
- $recipient : string
- $calendarData : string
Tags
Return values
boolhandleIMipReply()
Handle a iMip REPLY message
public
handleIMipReply(string $principalUri, string $sender, string $recipient, string $calendarData) : bool
Parameters
- $principalUri : string
- $sender : string
- $recipient : string
- $calendarData : string
Tags
Return values
boolhandleIMipRequest()
Handle a iMip REQUEST message
public
handleIMipRequest(string $principalUri, string $sender, string $recipient, string $calendarData) : bool
Parameters
- $principalUri : string
- $sender : string
- $recipient : string
- $calendarData : string
Tags
Return values
boolisEnabled()
Check if calendars are available
public
isEnabled() : bool
Tags
Return values
bool —true if enabled, false if not
newQuery()
Build a new query for searchForPrincipal
public
newQuery(string $principalUri) : ICalendarQuery
Parameters
- $principalUri : string
Tags
Return values
ICalendarQueryregister()
In order to improve lazy loading a closure can be registered which will be called in case calendars are actually requested
public
register(Closure $callable) : void
use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerCalendarProvider
Parameters
- $callable : Closure
Tags
registerCalendar()
Registers a calendar
public
registerCalendar(ICalendar $calendar) : void
use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerCalendarProvider
Parameters
- $calendar : ICalendar
Tags
search()
This function is used to search and find objects within the user's calendars.
public
search(string $pattern[, array<string|int, mixed> $searchProperties = [] ][, array<string|int, mixed> $options = [] ][, int|null $limit = null ][, int|null $offset = null ]) : array<string|int, mixed>
use \OCP\Calendar\IManager::searchForPrincipal
In case $pattern is empty all events/journals/todos will be returned.
Parameters
- $pattern : string
-
which should match within the $searchProperties
- $searchProperties : array<string|int, mixed> = []
-
defines the properties within the query pattern should match
- $options : array<string|int, mixed> = []
-
- optional parameters: ['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]]
- $limit : int|null = null
-
- limit number of search results
- $offset : int|null = null
-
- offset for paging of search results
Tags
Return values
array<string|int, mixed> —an array of events/journals/todos which are arrays of arrays of key-value-pairs
searchForPrincipal()
Query a principals calendar(s)
public
searchForPrincipal(ICalendarQuery $query) : array<string|int, array<string|int, mixed>>
Parameters
- $query : ICalendarQuery
Tags
Return values
array<string|int, array<string|int, mixed>>unregisterCalendar()
Unregisters a calendar
public
unregisterCalendar(ICalendar $calendar) : void
Parameters
- $calendar : ICalendar