Properties

$calendar

$calendar : string

The current calendar.

Type

string

$backgroundColor

$backgroundColor : string

The HTML background color to be used for this event.

Type

string

$foregroundColor

$foregroundColor : string

The HTML foreground color to be used for this event.

Type

string

$_params

$_params : array

A hash containing any parameters for the current driver.

Type

array

$_errormsg

$_errormsg : string

An error message to throw when something is wrong.

Type

string

$_kolab

$_kolab : \Kolab

Our Kolab server connection.

Type

\Kolab

$_events_cache

$_events_cache : array

Internal cache of Kronolith_Event_Kolab. eventID is key

Type

array

$_synchronized

$_synchronized : boolean

Indicates if we have synchronized this folder

Type

boolean

$_data

$_data : \Horde_Kolab_Storage_Data

The current calendar.

Type

\Horde_Kolab_Storage_Data

Methods

__construct()

__construct(array  $params = array(), string  $errormsg = null) 

Constructor.

Just stores the $params in our newly-created object. All other work is done by \initialize().

Parameters

array $params

Any parameters needed for this driver.

string $errormsg

A custom error message to use.

getParam()

getParam(string  $param) : mixed

Returns a configuration for this driver.

Parameters

string $param

A parameter name.

Returns

mixed —

The parameter value or null if not set.

setParam()

setParam(string  $param, mixed  $value) 

Sets a configuration for this driver.

Parameters

string $param

A parameter name.

mixed $value

The parameter value.

setParams()

setParams(string  $params) 

Sets all configuration parameters for this driver.

Parameters

string $params

A parameters hash.

open()

open(string  $calendar) 

Selects a calendar as the currently opened calendar.

Parameters

string $calendar

A calendar identifier.

backgroundColor()

backgroundColor() : string

Returns the background color of the current calendar.

Returns

string —

The calendar color.

colors()

colors() : array

Returns the colors of the current calendar.

Returns

array —

The calendar background and foreground color.

supportsTimezones()

supportsTimezones() : boolean

Returns whether this driver supports per-event timezones.

Returns

boolean —

Whether this drivers suppports per-event timezones.

search()

search(object  $query, boolean  $json = false) : array

Searches a calendar.

Parameters

object $query

An object with the criteria to search for.

boolean $json

Store the results of the events' toJson() method?

Throws

\Kronolith_Exception

Returns

array —

An array of search results keyed by date, with each date containing an array of Kronolith_Events occuring on that date.

nextRecurrence()

nextRecurrence(string  $eventId, \Horde_Date  $afterDate) : \Horde_Date|boolean

Finds the next recurrence of $eventId that's after $afterDate.

Parameters

string $eventId

The ID of the event to fetch.

\Horde_Date $afterDate

Return events after this date.

Throws

\Kronolith_Exception
\Horde_Exception_NotFound

Returns

\Horde_Date|boolean —

The date of the next recurrence or false if the event does not recur after $afterDate.

countEvents()

countEvents() : integer

Returns the number of events in the current calendar.

Throws

\Kronolith_Exception

Returns

integer —

The number of events.

initialize()

initialize() 

Attempts to open a Kolab Groupware folder.

getEvent()

getEvent(  $eventId = null) 

Stub to be overridden in the child class.

Parameters

$eventId

Throws

\Kronolith_Exception
\Horde_Exception_NotFound

getByUID()

getByUID(string  $uid, array  $calendars = null, boolean  $getAll = false) : \Kronolith_Event

Get an event or events with the given UID value.

Parameters

string $uid

The UID to match

array $calendars

A restricted array of calendar ids to search

boolean $getAll

Return all matching events? If this is false, an error will be returned if more than one event is found.

Throws

\Kronolith_Exception
\Horde_Exception_NotFound

Returns

\Kronolith_Event

listAlarms()

listAlarms(  $date,   $fullevent = false) 

Stub to be overridden in the child class.

Parameters

$date
$fullevent

Throws

\Kronolith_Exception

listEvents()

listEvents(\Horde_Date  $startDate = null, \Horde_Date  $endDate = null, array  $options = array()) 

Lists all events in the time range, optionally restricting results to only events with alarms.

Parameters

\Horde_Date $startDate

The start of range date.

\Horde_Date $endDate

The end of date range.

array $options

Additional options:

  • show_recurrence: (boolean) Return every instance of a recurring event? DEFAULT: false (Only return recurring events once inside $startDate - $endDate range)
  • has_alarm: (boolean) Only return events with alarms. DEFAULT: false (Return all events)
  • json: (boolean) Store the results of the event's toJson() method? DEFAULT: false
  • cover_dates: (boolean) Add the events to all days that they cover? DEFAULT: true
  • hide_exceptions: (boolean) Hide events that represent exceptions to a recurring event. DEFAULT: false (Do not hide exception events)
  • fetch_tags: (boolean) Fetch tags for all events. DEFAULT: false (Do not fetch event tags)

Throws

\Kronolith_Exception

saveEvent()

saveEvent(\Kronolith_Event  $event) : string

Saves an event in the backend.

If it is a new event, it is added, otherwise the event is updated.

Parameters

\Kronolith_Event $event

The event to save.

Throws

\Horde_Mime_Exception
\Kronolith_Exception

Returns

string —

The event id.

exists()

exists(string  $uid, string  $calendar_id = null) : string|boolean

Checks if the event's UID already exists and returns all event ids with that UID.

Parameters

string $uid

The event's uid.

string $calendar_id

Calendar to search in.

Throws

\Kronolith_Exception

Returns

string|boolean —

Returns a string with event_id or false if not found.

move()

move(string  $eventId, string  $newCalendar) 

Moves an event to a new calendar.

Parameters

string $eventId

The event to move.

string $newCalendar

The new calendar.

Throws

\Kronolith_Exception
\Horde_Exception_NotFound

delete()

delete(string  $calendar) 

Delete all of a calendar's events.

Note: This method only "Purges" the calendar - removing the events, it doesn't remove the calendar itself.

Parameters

string $calendar

The name of the calendar to delete.

Throws

\Kronolith_Exception

deleteEvent()

deleteEvent(mixed  $eventId, boolean  $silent = false) 

Deletes an event.

Parameters

mixed $eventId

Either the event id to delete, or the event object.

boolean $silent

Don't send notifications, used when deleting events in bulk from maintenance tasks.

Throws

\Kronolith_Exception
\Horde_Exception_NotFound
\Horde_Mime_Exception

filterEventsByCalendar()

filterEventsByCalendar(  $uids,   $calendar) 

Stub to be overridden in the child class if it can implement.

Parameters

$uids
$calendar

Throws

\Kronolith_Exception

removeUserData()

removeUserData(  $user) 

Stub for child class to override if it can implement.

Parameters

$user

Throws

\Kronolith_Exception

synchronize()

synchronize(boolean  $force = false, string  $token = false) 

Synchronize kolab storage backend.

We delay initial synchronization to the first use so multiple calendars don't add to the total latency. This function must be called before all internal driver functions.

Parameters

boolean $force

If true, forces synchronization, even if we have already done so.

string $token

A synchroniziation token, if available.

reset()

reset() 

Reset internal variable on share change

_listEvents()

_listEvents(\Horde_Date  $startDate = null, \Horde_Date  $endDate = null, array  $options = array()) 

Lists all events in the time range, optionally restricting results to only events with alarms.

Parameters

\Horde_Date $startDate

The start of range date.

\Horde_Date $endDate

The end of date range.

array $options

Additional options:

  • show_recurrence: (boolean) Return every instance of a recurring event? DEFAULT: false (Only return recurring events once inside $startDate - $endDate range)
  • has_alarm: (boolean) Only return events with alarms. DEFAULT: false (Return all events)
  • json: (boolean) Store the results of the event's toJson() method? DEFAULT: false
  • cover_dates: (boolean) Add the events to all days that they cover? DEFAULT: true
  • hide_exceptions: (boolean) Hide events that represent exceptions to a recurring event. DEFAULT: false (Do not hide exception events)
  • fetch_tags: (boolean) Fetch tags for all events. DEFAULT: false (Do not fetch event tags)

Throws

\Kronolith_Exception

_addEvent()

_addEvent(\Kronolith_Event  $event) : string

Adds an event to the backend.

Parameters

\Kronolith_Event $event

The event to save.

Throws

\Horde_Mime_Exception

Returns

string —

The event id.

_updateEvent()

_updateEvent(\Kronolith_Event  $event) : string

Updates an existing event in the backend.

Parameters

\Kronolith_Event $event

The event to save.

Throws

\Horde_Mime_Exception

Returns

string —

The event id.

_move()

_move(string  $eventId, string  $newCalendar) : \Kronolith_Event

Moves an event to a new calendar.

Parameters

string $eventId

The event to move.

string $newCalendar

The new calendar.

Throws

\Kronolith_Exception
\Horde_Exception_NotFound

Returns

\Kronolith_Event

The old event.

_deleteEvent()

_deleteEvent(string  $eventId,   $silent = false) : \Kronolith_Event

Deletes an event.

Parameters

string $eventId

The ID of the event to delete.

$silent

Throws

\Kronolith_Exception
\Horde_Exception_NotFound
\Horde_Mime_Exception

Returns

\Kronolith_Event

Returns the deleted event.

_handleNotifications()

_handleNotifications(\Kronolith_Event  $event, string  $action) 

Wrapper for sending notifications, so that we can overwrite this action in Kronolith_Driver_Resource.

Parameters

\Kronolith_Event $event
string $action

_updateTags()

_updateTags(\Kronolith_Event  $event) 

Helper function to update an existing event's tags to tagger storage.

Parameters

\Kronolith_Event $event

The event to update

_addTags()

_addTags(\Kronolith_Event  $event) 

Helper function to add tags from a newly creted event to the tagger.

Parameters

\Kronolith_Event $event

The event to save tags to storage for.

_saveEvent()

_saveEvent(\Kronolith_Event  $event,   $edit) : string

Saves an event in the backend.

Parameters

\Kronolith_Event $event

The event to save.

$edit

Throws

\Horde_Mime_Exception

Returns

string —

The event id.