Nextcloud PHP API (stable18)

IManager

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
since
13.0.0

Table of Contents

clear()  : void
removes all registered calendar instances
getCalendars()  : \OCP\Calendar\ICalendar[]
isEnabled()  : bool
Check if calendars are available
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
This function is used to search and find objects within the user's calendars.
unregisterCalendar()  : void
Unregisters a calendar

Methods

clear()

removes all registered calendar instances

public clear() : void
Tags
since
13.0.0

getCalendars()

public getCalendars() : \OCP\Calendar\ICalendar[]
Tags
since
13.0.0
Return values
\OCP\Calendar\ICalendar[]

isEnabled()

Check if calendars are available

public isEnabled() : bool
Tags
since
13.0.0
Return values
bool

true if enabled, false if not

register()

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
Parameters
$callable : Closure
Tags
since
13.0.0

registerCalendar()

Registers a calendar

public registerCalendar(ICalendar $calendar) : void
Parameters
$calendar : ICalendar
Tags
since
13.0.0

This function is used to search and find objects within the user's calendars.

public search(string $pattern[, array $searchProperties = [] ][, array $options = [] ][, int|null $limit = null ][, int|null $offset = null ]) : array

In case $pattern is empty all events/journals/todos will be returned.

Parameters
$pattern : string

which should match within the $searchProperties

$searchProperties : array = []

defines the properties within the query pattern should match

$options : array = []
  • 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
since
13.0.0
Return values
array

an array of events/journals/todos which are arrays of arrays of key-value-pairs

unregisterCalendar()

Unregisters a calendar

public unregisterCalendar(ICalendar $calendar) : void
Parameters
$calendar : ICalendar
Tags
since
13.0.0

Search results