Properties

$_links

$_links : array

Links.

Type

array

Methods

shareHelp()

shareHelp() : string

Returns the share helper prefix

Returns

string

modified()

modified(string  $uid, string  $calendar = null) : integer

Returns the last modification timestamp for the given uid.

Parameters

string $uid

The uid to look for.

string $calendar

The calendar to search in.

Returns

integer —

The timestamp for the last modification of $uid.

browse()

browse(string  $path = '', array  $properties = array()) : array

Browse through Kronolith's object tree.

Parameters

string $path

The level of the tree to browse.

array $properties

The item properties to return. Defaults to 'name', 'icon', and 'browseable'.

Throws

\Kronolith_Exception

Returns

array —

The contents of $path

put()

put(string  $path, string  $content, string  $content_type) : array

Saves a file into the Kronolith tree.

Parameters

string $path

The path where to PUT the file.

string $content

The file content.

string $content_type

The file's content type.

Throws

\Kronolith_Exception

Returns

array —

The event UIDs.

path_delete()

path_delete(string  $path) 

Deletes a file from the Kronolith tree.

Parameters

string $path

The path to the file.

Throws

\Kronolith_Exception

listCalendars()

listCalendars(boolean  $owneronly = false, integer  $permission = null) : array

Returns all calendars a user has access to, according to several parameters/permission levels.

Parameters

boolean $owneronly

Only return calendars that this user owns? Defaults to false.

integer $permission

The permission to filter calendars by.

Returns

array —

The calendar list.

sources()

sources(boolean  $writeable = false, boolean  $sync_only = false) : array

Returns a list of available sources.

Parameters

boolean $writeable

If true, limits to writeable sources.

boolean $sync_only

Only include syncable sources.

Returns

array —

An array of the available sources. Keys are source IDs, values are source titles.

getDefaultShare()

getDefaultShare() : string

Retrieve the UID for the current user's default calendar.

Returns

string —

UID.

listUids()

listUids(string|array  $calendars = null, object  $startstamp, object  $endstamp) : array

Returns the ids of all the events that happen within a time period.

Only includes recurring events once per time period, and does not include events that represent exceptions, making this method useful for syncing purposes. For more control, use the listEvents method.

Parameters

string|array $calendars

The calendar to check for events.

object $startstamp

The start of the time range.

object $endstamp

The end of the time range.

Throws

\Kronolith_Exception

Returns

array —

The event ids happening in this time period.

listBy()

listBy(string  $action, integer  $timestamp, string  $calendar = null, integer  $end = null, boolean  $isModSeq = false) : array

Returns an array of UIDs for events that have had $action happen since $timestamp.

Parameters

string $action

The action to check for - add, modify, or delete.

integer $timestamp

The time to start the search.

string $calendar

The calendar to search in.

integer $end

The optional ending timestamp

boolean $isModSeq

If true, $timestamp and $end are modification sequences and not timestamps. @since 4.1.1

Throws

\Kronolith_Exception
\Horde_History_Exception
\InvalidArgumentException

Returns

array —

An array of UIDs matching the action and time criteria.

getChanges()

getChanges(integer  $start, integer  $end, boolean  $ignoreExceptions = true, boolean  $isModSeq = false, string|array  $calendars = null) : array

Method for obtaining all server changes between two timestamps. Basically a wrapper around listBy(), but returns an array containing all adds, edits and deletions. If $ignoreExceptions is true, events representing recurring event exceptions will not be included in the results.

Parameters

integer $start

The starting timestamp

integer $end

The ending timestamp.

boolean $ignoreExceptions

Do not include exceptions in results.

boolean $isModSeq

If true, $timestamp and $end are modification sequences and not timestamps. @since 4.1.1

string|array $calendars

The sources to check. @since 4.2.0

Throws

\Horde_Exception_PermissionDenied
\Kronolith_Exception

Returns

array —

An hash with 'add', 'modify' and 'delete' arrays.

getChangesByModSeq()

getChangesByModSeq(integer  $start, integer  $end, string|array  $calendars = null) : array

Return all changes occuring between the specified modification sequences.

Parameters

integer $start

The starting modseq.

integer $end

The ending modseq.

string|array $calendars

The sources to check. @since 4.2.0

Returns

array —

The changes @see getChanges()

getActionTimestamp()

getActionTimestamp(string  $uid, string  $action, string  $calendar = null, boolean  $modSeq = false) : integer

Returns the timestamp of an operation for a given uid an action

Parameters

string $uid

The uid to look for.

string $action

The action to check for - add, modify, or delete.

string $calendar

The calendar to search in.

boolean $modSeq

Request a modification sequence instead of a timestamp. @since 4.1.1

Throws

\Kronolith_Exception
\InvalidArgumentException

Returns

integer —

The timestamp or modseq for this action.

getHighestModSeq()

getHighestModSeq(string  $id = null) : integer

Return the largest modification sequence from the history backend.

Parameters

string $id

The calendar id to return the hightest MDOSEQ for. If null, the highest MODSEQ across all calendars is returned. @since 4.2.0

Returns

integer —

The MODSEQ value.

import()

import(string  $content, string  $contentType, string  $calendar = null, boolean  $hash = false) : array

Imports an event represented in the specified content type.

Parameters

string $content

The content of the event.

string $contentType

What format is the data in? Currently supports:

                            text/calendar
                            text/x-vcalendar
                            activesync
                            
string $calendar

What calendar should the event be added to?

boolean $hash

If true, return a hash for EAS additions. @since 4.3.0 @todo Remove for 5.0 and make this the normal return.

Throws

\Kronolith_Exception

Returns

array —

The event's UID.

quickAdd()

quickAdd(string  $text, string  $calendar = null) : array

Imports an event parsed from a string.

Parameters

string $text

The text to parse into an event

string $calendar

The calendar into which the event will be imported. If 'null', the user's default calendar will be used.

Throws

\Kronolith_Exception

Returns

array —

The UID of all events that were added.

export()

export(string  $uid, string  $contentType, array  $options = array(), array  $calendars = null) : string

Exports an event, identified by UID, in the requested content type.

Parameters

string $uid

Identify the event to export.

string $contentType

What format should the data be in? A string with one of:

                            text/calendar (VCALENDAR 2.0. Recommended as
                                           this is specified in rfc2445)
                            text/x-vcalendar (old VCALENDAR 1.0 format.
                                             Still in wide use)
                            activesync (Horde_ActiveSync_Message_Appointment)
                           
array $options

Any additional options to be passed to the exporter.

array $calendars

Require event to be in these calendars. @since 4.2.0

Throws

\Kronolith_Exception
\Horde_Exception_NotFound

Returns

string —

The requested data.

exportCalendar()

exportCalendar(string  $calendar, string  $contentType) : string

Exports a calendar in the requested content type.

Parameters

string $calendar

The calendar to export.

string $contentType

What format should the data be in? A string with one of:

                            text/calendar (VCALENDAR 2.0. Recommended as
                                           this is specified in rfc2445)
                            text/x-vcalendar (old VCALENDAR 1.0 format.
                                             Still in wide use)
                            

Throws

\Kronolith_Exception

Returns

string —

The iCalendar representation of the calendar.

getAttachment()

getAttachment(string  $calendar, string  $uid, string  $filename) : array

Return an event attachment.

Parameters

string $calendar

The calendar ID.

string $uid

The UID of the event the file is attached to.

string $filename

The name of the file.

Throws

\Kronolith_Exception

Returns

array —

An array containing the following keys: data (stream): A file pointer to the attachment data. content-type (string): The mime-type of the contents.

delete()

delete(string|array  $uid, mixed  $recurrenceId = null, string  $range = null) 

Deletes an event identified by UID.

Parameters

string|array $uid

A single UID or an array identifying the event(s) to delete.

mixed $recurrenceId

The reccurenceId for the event instance, if this is a deletion of a recurring event instance ($uid must not be an array). Either a string or Horde_Date object.

string $range

The range value if deleting a recurring event instance. Only supported values are null or Kronolith::RANGE_THISANDFUTURE. @since 4.1.5

Throws

\Kronolith_Exception

move()

move(string  $uid, string  $source, string  $target) 

Move an event.

Parameters

string $uid

The event UID.

string $source

The source calendar's id.

string $target

The target calendar's id.

replace()

replace(string  $uid, mixed  $content, string  $contentType, string  $calendar = null) : mixed

Replaces the event identified by UID with the content represented in the specified contentType.

Parameters

string $uid

Idenfity the event to replace.

mixed $content

The content of the event. String or Horde_Icalendar_Vevent

string $contentType

What format is the data in? Currently supports: text/calendar text/x-vcalendar (Ignored if content is Horde_Icalendar_Vevent) activesync (Horde_ActiveSync_Message_Appointment)

string $calendar

Ensure the event is replaced in the specified calendar. @since 4.2.0

Throws

\Kronolith_Exception

Returns

mixed —

For EAS operations, an array of 'uid' and 'atchash' are returned. @since 4.3.0

getFreeBusy()

getFreeBusy(integer  $startstamp = null, integer  $endstamp = null, string  $calendar = null) : \Horde_Icalendar_Vfreebusy

Generates free/busy information for a given time period.

Parameters

integer $startstamp

The start of the time period to retrieve.

integer $endstamp

The end of the time period to retrieve.

string $calendar

The calendar to view free/busy slots for. Defaults to the user's default calendar.

Throws

\Kronolith_Exception

Returns

\Horde_Icalendar_Vfreebusy —

A freebusy object that covers the specified time period.

lookupFreeBusy()

lookupFreeBusy(string  $email, boolean  $json = false) 

Attempt to lookup the free/busy information for the given email address.

Parameters

string $email

The email to lookup free/busy information for.

boolean $json

Return the data in a simple json format. If false, returns the vCalander object.

eventFromUID()

eventFromUID(string  $uid,   $calendar = null) : \Kronolith_Event

Retrieves a Kronolith_Event object, given an event UID.

Parameters

string $uid

The event's UID.

$calendar

Throws

\Kronolith_Exception

Returns

\Kronolith_Event

A valid Kronolith_Event.

updateAttendee()

updateAttendee(\Horde_Icalendar_Vevent  $response, string  $sender = null) 

Updates an attendee's response status for a specified event.

Parameters

\Horde_Icalendar_Vevent $response

A Horde_Icalendar_Vevent object, with a valid UID attribute that points to an existing event. This is typically the vEvent portion of an iTip meeting-request response, with the attendee's response in an ATTENDEE parameter.

string $sender

The email address of the person initiating the update. Attendees are only updated if this address matches.

Throws

\Kronolith_Exception

listEvents()

listEvents(integer  $startstamp = null, integer  $endstamp = null, array  $calendars = null, boolean  $showRecurrence = true, boolean  $alarmsOnly = false, boolean  $showRemote = true, boolean  $hideExceptions = false, boolean  $coverDates = true,   $fetchTags = false) : array

Lists events for a given time period.

Parameters

integer $startstamp

The start of the time period to retrieve.

integer $endstamp

The end of the time period to retrieve.

array $calendars

The calendars to view events from. Defaults to the user's default calendar.

boolean $showRecurrence

Return every instance of a recurring event? If false, will only return recurring events once inside the $startDate - $endDate range.

boolean $alarmsOnly

Filter results for events with alarms. Defaults to false.

boolean $showRemote

Return events from remote calendars and listTimeObject API as well?

boolean $hideExceptions

Hide events that represent exceptions to a recurring event (events with baseid set)?

boolean $coverDates

Add multi-day events to all dates?

$fetchTags

Throws

\Kronolith_Exception

Returns

array —

A list of event hashes.

subscribe()

subscribe(array  $calendar) 

Subscribe to a calendar.

Parameters

array $calendar

Calendar description hash, with required 'type' parameter. Currently supports 'http' and 'webcal' for remote calendars.

Throws

\Kronolith_Exception

unsubscribe()

unsubscribe(array  $calendar) 

Unsubscribe from a calendar.

Parameters

array $calendar

Calendar description array, with required 'type' parameter. Currently supports 'http' and 'webcal' for remote calendars.

Throws

\Kronolith_Exception

lock()

lock(string  $calendar, string  $event = null) : mixed

Places an exclusive lock for a calendar or an event.

Parameters

string $calendar

The id of the calendar to lock

string $event

The uid for the event to lock

Throws

\Kronolith_Exception

Returns

mixed —

A lock ID on success, false if:

  • The calendar is already locked
  • The event is already locked
  • A calendar lock was requested and an event is already locked in the calendar

unlock()

unlock(array  $calendar, array  $lockid) 

Releases a lock.

Parameters

array $calendar

The event to lock.

array $lockid

The lock id to unlock.

Throws

\Kronolith_Exception

checkLocks()

checkLocks(array  $calendar, array  $event = null) 

Check for existing calendar or event locks.

Parameters

array $calendar

The calendar to check locks for.

array $event

The event to check locks for.

Throws

\Kronolith_Exception

getFbCalendars()

getFbCalendars() : array

Returns

array —

A list of calendars used to display free/busy information

listTagInfo()

listTagInfo(array  $tags = null, string  $user = null) : array

Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.

Parameters

array $tags

An optional array of tag_ids. If omitted, all tags will be included.

string $user

Restrict result to those tagged by $user.

Returns

array —

An array containing tag_name, and total

searchTags()

searchTags(array  $names, integer  $max = 10, integer  $from, string  $resource_type = '', string  $user = null, boolean  $raw = false) : array

SearchTags API: Returns an application-agnostic array (useful for when doing a tag search across multiple applications)

The 'raw' results array can be returned instead by setting $raw = true.

Parameters

array $names

An array of tag_names to search for.

integer $max

The maximum number of resources to return.

integer $from

The number of the resource to start with.

string $resource_type

The resource type [event, calendar, '']

string $user

Restrict results to resources owned by $user.

boolean $raw

Return the raw data?

Returns

array —

An array of results:

 'title'    - The title for this resource.
 'desc'     - A terse description of this resource.
 'view_url' - The URL to view this resource.
 'app'      - The Horde application this resource belongs to.

addCalendar()

addCalendar(string  $name, array  $params = array()) : string

Create a new calendar for the existing user.

Parameters

string $name

The calendar's display name.

array $params

Returns

string —

The new calendar's UID.

deleteCalendar()

deleteCalendar(string  $id) 

Delete the specified calendar.

Parameters

string $id

The calendar id.

getCalendar()

getCalendar(string  $id = null) : \Kronolith_Calendar

Return an internal calendar.

Parameters

string $id

The calendar uid (share name).

Returns

\Kronolith_Calendar

The calendar object.

updateCalendar()

updateCalendar(string  $id, array  $info) 

Update an internal calendar's information.

Parameters

string $id

The calendar id.

array $info

An array of calendar information. @see self::addCalendar()

_addiCalEvent()

_addiCalEvent(\Horde_Icalendar_Vevent  $content, \Kronolith_Driver  $driver, boolean  $exception = false) : string

Imports a single vEvent part to storage.

Parameters

\Horde_Icalendar_Vevent $content

The vEvent part

\Kronolith_Driver $driver

The kronolith driver

boolean $exception

Content represents an exception in a recurrence series.

Returns

string —

The new event's uid