Kronolith_Driver_Kolab
extends Kronolith_Driver
in package
Horde Kronolith driver for the Kolab IMAP Server.
Copyright 2004-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Tags
Table of Contents
- $backgroundColor : string
- The HTML background color to be used for this event.
- $calendar : string
- The current calendar.
- $foregroundColor : string
- The HTML foreground color to be used for this event.
- $_params : array<string|int, mixed>
- A hash containing any parameters for the current driver.
- $_data : Horde_Kolab_Storage_Data
- The current calendar.
- $_errormsg : string
- An error message to throw when something is wrong.
- $_events_cache : array<string|int, mixed>
- Internal cache of Kronolith_Event_Kolab. eventID is key
- $_kolab : Kolab
- Our Kolab server connection.
- $_synchronized : bool
- Indicates if we have synchronized this folder
- __construct() : mixed
- Constructor.
- backgroundColor() : string
- Returns the background color of the current calendar.
- colors() : array<string|int, mixed>
- Returns the colors of the current calendar.
- countEvents() : int
- Returns the number of events in the current calendar.
- delete() : mixed
- Delete all of a calendar's events.
- deleteEvent() : mixed
- Deletes an event.
- exists() : string|bool
- Checks if the event's UID already exists and returns all event ids with that UID.
- filterEventsByCalendar() : mixed
- Stub to be overridden in the child class if it can implement.
- getByUID() : Kronolith_Event
- Get an event or events with the given UID value.
- getEvent() : mixed
- Stub to be overridden in the child class.
- getParam() : mixed
- Returns a configuration for this driver.
- initialize() : mixed
- Attempts to open a Kolab Groupware folder.
- listAlarms() : mixed
- Stub to be overridden in the child class.
- listEvents() : mixed
- Lists all events in the time range, optionally restricting results to only events with alarms.
- move() : mixed
- Moves an event to a new calendar.
- nextRecurrence() : Horde_Date|bool
- Finds the next recurrence of $eventId that's after $afterDate.
- open() : mixed
- Selects a calendar as the currently opened calendar.
- removeUserData() : mixed
- Stub for child class to override if it can implement.
- reset() : mixed
- Reset internal variable on share change
- saveEvent() : string
- Saves an event in the backend.
- search() : array<string|int, mixed>
- Searches a calendar.
- setParam() : mixed
- Sets a configuration for this driver.
- setParams() : mixed
- Sets all configuration parameters for this driver.
- supportsTimezones() : bool
- Returns whether this driver supports per-event timezones.
- synchronize() : mixed
- Synchronize kolab storage backend.
- _addEvent() : string
- Adds an event to the backend.
- _addTags() : mixed
- Helper function to add tags from a newly creted event to the tagger.
- _deleteEvent() : Kronolith_Event
- Deletes an event.
- _handleNotifications() : mixed
- Wrapper for sending notifications, so that we can overwrite this action in Kronolith_Driver_Resource.
- _listEvents() : mixed
- Lists all events in the time range, optionally restricting results to only events with alarms.
- _move() : Kronolith_Event
- Moves an event to a new calendar.
- _saveEvent() : string
- Saves an event in the backend.
- _updateEvent() : string
- Updates an existing event in the backend.
- _updateTags() : mixed
- Helper function to update an existing event's tags to tagger storage.
Properties
$backgroundColor
The HTML background color to be used for this event.
public
string
$backgroundColor
= '#ddd'
$calendar
The current calendar.
public
string
$calendar
$foregroundColor
The HTML foreground color to be used for this event.
public
string
$foregroundColor
= '#000'
$_params
A hash containing any parameters for the current driver.
protected
array<string|int, mixed>
$_params
= array()
$_data
The current calendar.
private
Horde_Kolab_Storage_Data
$_data
$_errormsg
An error message to throw when something is wrong.
private
string
$_errormsg
$_events_cache
Internal cache of Kronolith_Event_Kolab. eventID is key
private
array<string|int, mixed>
$_events_cache
$_kolab
Our Kolab server connection.
private
Kolab
$_kolab
= \null
$_synchronized
Indicates if we have synchronized this folder
private
bool
$_synchronized
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $params = array() ][, string $errormsg = null ]) : mixed
Just stores the $params in our newly-created object. All other work is done by .
Parameters
- $params : array<string|int, mixed> = array()
-
Any parameters needed for this driver.
- $errormsg : string = null
-
A custom error message to use.
Return values
mixed —backgroundColor()
Returns the background color of the current calendar.
public
backgroundColor() : string
Return values
string —The calendar color.
colors()
Returns the colors of the current calendar.
public
colors() : array<string|int, mixed>
Return values
array<string|int, mixed> —The calendar background and foreground color.
countEvents()
Returns the number of events in the current calendar.
public
countEvents() : int
Tags
Return values
int —The number of events.
delete()
Delete all of a calendar's events.
public
delete(string $calendar) : mixed
Parameters
- $calendar : string
-
The name of the calendar to delete.
Tags
Return values
mixed —deleteEvent()
Deletes an event.
public
deleteEvent(mixed $eventId[, bool $silent = false ]) : mixed
Parameters
- $eventId : mixed
-
Either the event id to delete, or the event object.
- $silent : bool = false
-
Don't send notifications, used when deleting events in bulk from maintenance tasks.
Tags
Return values
mixed —exists()
Checks if the event's UID already exists and returns all event ids with that UID.
public
exists(string $uid[, string $calendar_id = null ]) : string|bool
Parameters
- $uid : string
-
The event's uid.
- $calendar_id : string = null
-
Calendar to search in.
Tags
Return values
string|bool —Returns a string with event_id or false if not found.
filterEventsByCalendar()
Stub to be overridden in the child class if it can implement.
public
filterEventsByCalendar(mixed $uids, mixed $calendar) : mixed
Parameters
- $uids : mixed
- $calendar : mixed
Tags
Return values
mixed —getByUID()
Get an event or events with the given UID value.
public
getByUID(string $uid[, array<string|int, mixed> $calendars = null ][, bool $getAll = false ]) : Kronolith_Event
Parameters
- $uid : string
-
The UID to match
- $calendars : array<string|int, mixed> = null
-
A restricted array of calendar ids to search
- $getAll : bool = false
-
Return all matching events? If this is false, an error will be returned if more than one event is found.
Tags
Return values
Kronolith_Event —getEvent()
Stub to be overridden in the child class.
public
getEvent([mixed $eventId = null ]) : mixed
Parameters
- $eventId : mixed = null
Tags
Return values
mixed —getParam()
Returns a configuration for this driver.
public
getParam(string $param) : mixed
Parameters
- $param : string
-
A parameter name.
Return values
mixed —The parameter value or null if not set.
initialize()
Attempts to open a Kolab Groupware folder.
public
initialize() : mixed
Return values
mixed —listAlarms()
Stub to be overridden in the child class.
public
listAlarms(mixed $date[, mixed $fullevent = false ]) : mixed
Parameters
- $date : mixed
- $fullevent : mixed = false
Tags
Return values
mixed —listEvents()
Lists all events in the time range, optionally restricting results to only events with alarms.
public
listEvents([Horde_Date $startDate = null ][, Horde_Date $endDate = null ][, array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $startDate : Horde_Date = null
-
The start of range date.
- $endDate : Horde_Date = null
-
The end of date range.
- $options : array<string|int, mixed> = array()
-
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)
Tags
Return values
mixed —move()
Moves an event to a new calendar.
public
move(string $eventId, string $newCalendar) : mixed
Parameters
- $eventId : string
-
The event to move.
- $newCalendar : string
-
The new calendar.
Tags
Return values
mixed —nextRecurrence()
Finds the next recurrence of $eventId that's after $afterDate.
public
nextRecurrence(string $eventId, Horde_Date $afterDate) : Horde_Date|bool
Parameters
- $eventId : string
-
The ID of the event to fetch.
- $afterDate : Horde_Date
-
Return events after this date.
Tags
Return values
Horde_Date|bool —The date of the next recurrence or false if the event does not recur after $afterDate.
open()
Selects a calendar as the currently opened calendar.
public
open(string $calendar) : mixed
Parameters
- $calendar : string
-
A calendar identifier.
Return values
mixed —removeUserData()
Stub for child class to override if it can implement.
public
removeUserData(mixed $user) : mixed
Parameters
- $user : mixed
Tags
Return values
mixed —reset()
Reset internal variable on share change
public
reset() : mixed
Return values
mixed —saveEvent()
Saves an event in the backend.
public
saveEvent(Kronolith_Event $event) : string
If it is a new event, it is added, otherwise the event is updated.
Parameters
- $event : Kronolith_Event
-
The event to save.
Tags
Return values
string —The event id.
search()
Searches a calendar.
public
search(object $query[, bool $json = false ]) : array<string|int, mixed>
Parameters
- $query : object
-
An object with the criteria to search for.
- $json : bool = false
-
Store the results of the events' toJson() method?
Tags
Return values
array<string|int, mixed> —An array of search results keyed by date, with each date containing an array of Kronolith_Events occuring on that date.
setParam()
Sets a configuration for this driver.
public
setParam(string $param, mixed $value) : mixed
Parameters
- $param : string
-
A parameter name.
- $value : mixed
-
The parameter value.
Return values
mixed —setParams()
Sets all configuration parameters for this driver.
public
setParams(string $params) : mixed
Parameters
- $params : string
-
A parameters hash.
Return values
mixed —supportsTimezones()
Returns whether this driver supports per-event timezones.
public
supportsTimezones() : bool
Return values
bool —Whether this drivers suppports per-event timezones.
synchronize()
Synchronize kolab storage backend.
public
synchronize([bool $force = false ][, mixed $token = false ]) : mixed
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
- $force : bool = false
-
If true, forces synchronization, even if we have already done so.
- $token : mixed = false
-
A synchroniziation token, if available.
Return values
mixed —_addEvent()
Adds an event to the backend.
protected
_addEvent(Kronolith_Event $event) : string
Parameters
- $event : Kronolith_Event
-
The event to save.
Tags
Return values
string —The event id.
_addTags()
Helper function to add tags from a newly creted event to the tagger.
protected
_addTags(Kronolith_Event $event) : mixed
Parameters
- $event : Kronolith_Event
-
The event to save tags to storage for.
Return values
mixed —_deleteEvent()
Deletes an event.
protected
_deleteEvent(string $eventId[, mixed $silent = false ]) : Kronolith_Event
Parameters
- $eventId : string
-
The ID of the event to delete.
- $silent : mixed = false
Tags
Return values
Kronolith_Event —Returns the deleted event.
_handleNotifications()
Wrapper for sending notifications, so that we can overwrite this action in Kronolith_Driver_Resource.
protected
_handleNotifications(Kronolith_Event $event, string $action) : mixed
Parameters
- $event : Kronolith_Event
- $action : string
Return values
mixed —_listEvents()
Lists all events in the time range, optionally restricting results to only events with alarms.
protected
_listEvents([Horde_Date $startDate = null ][, Horde_Date $endDate = null ][, array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $startDate : Horde_Date = null
-
The start of range date.
- $endDate : Horde_Date = null
-
The end of date range.
- $options : array<string|int, mixed> = array()
-
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)
Tags
Return values
mixed —_move()
Moves an event to a new calendar.
protected
_move(string $eventId, string $newCalendar) : Kronolith_Event
Parameters
- $eventId : string
-
The event to move.
- $newCalendar : string
-
The new calendar.
Tags
Return values
Kronolith_Event —The old event.
_saveEvent()
Saves an event in the backend.
protected
_saveEvent(Kronolith_Event $event, mixed $edit) : string
Parameters
- $event : Kronolith_Event
-
The event to save.
- $edit : mixed
Tags
Return values
string —The event id.
_updateEvent()
Updates an existing event in the backend.
protected
_updateEvent(Kronolith_Event $event) : string
Parameters
- $event : Kronolith_Event
-
The event to save.
Tags
Return values
string —The event id.
_updateTags()
Helper function to update an existing event's tags to tagger storage.
protected
_updateTags(Kronolith_Event $event) : mixed
Parameters
- $event : Kronolith_Event
-
The event to update