PHP Class Kronolith_Driver, horde

Copyright 1999-2015 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Chuck Hagenbuch ([email protected])
Author: Jan Schneider ([email protected])
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$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.

Protected Properties

Property Type Description
$_params array A hash containing any parameters for the current driver.

Public Methods

Method Description
__construct ( array $params = [], string $errormsg = null ) Constructor.
backgroundColor ( ) : string Returns the background color of the current calendar.
colors ( ) : array Returns the colors of the current calendar.
countEvents ( ) : integer Returns the number of events in the current calendar.
delete ( $calendar ) Stub to be overridden in the child class.
deleteEvent ( mixed $eventId, boolean $silent = false ) Deletes an event.
exists ( $uid, $calendar_id = null ) Stub for child class to override if it can implement.
filterEventsByCalendar ( $uids, $calendar ) Stub to be overridden in the child class if it can implement.
getByUID ( $uid, $calendars = null, $getAll = false ) Stub to be overridden in the child class.
getEvent ( $eventId = null ) Stub to be overridden in the child class.
getParam ( string $param ) : mixed Returns a configuration for this driver.
initialize ( ) Stub to initiate a driver.
listAlarms ( $date, $fullevent = false ) Stub to be overridden in the child class.
listEvents ( Horde_Date $startDate = null, Horde_Date $endDate = null, array $options = [] ) Lists all events in the time range, optionally restricting results to only events with alarms.
move ( string $eventId, string $newCalendar ) Moves an event to a new calendar.
nextRecurrence ( string $eventId, Horde_Date $afterDate ) : Horde_Date | boolean Finds the next recurrence of $eventId that's after $afterDate.
open ( string $calendar ) Selects a calendar as the currently opened calendar.
removeUserData ( $user ) Stub for child class to override if it can implement.
saveEvent ( Kronolith_Event $event ) : string Saves an event in the backend.
search ( object $query, boolean $json = false ) : array Searches a calendar.
setParam ( string $param, mixed $value ) Sets a configuration for this driver.
setParams ( string $params ) Sets all configuration parameters for this driver.
supportsTimezones ( ) : boolean Returns whether this driver supports per-event timezones.
synchronize ( boolean $force = false, string $token = false ) Synchronize if driver needs to.

Protected Methods

Method Description
_addEvent ( Kronolith_Event $event ) Stub to be overridden in the child class.
_addTags ( Kronolith_Event $event ) Helper function to add tags from a newly creted event to the tagger.
_deleteEvent ( mixed $eventId ) : Kronolith_Event Stub to be overridden in the child class.
_handleNotifications ( Kronolith_Event $event, string $action ) Wrapper for sending notifications, so that we can overwrite this action in Kronolith_Driver_Resource.
_listEvents ( Horde_Date $startDate = null, Horde_Date $endDate = null, array $options = [] ) Stub to be overridden in concrete class.
_move ( $eventId, $newCalendar ) Stub to be overridden in the child class.
_updateEvent ( Kronolith_Event $event ) Stub to be overridden in the child class.
_updateTags ( Kronolith_Event $event ) Helper function to update an existing event's tags to tagger storage.

Method Details

__construct() public method

Just stores the $params in our newly-created object. All other work is done by {@link initialize()}.
public __construct ( array $params = [], string $errormsg = null )
$params array Any parameters needed for this driver.
$errormsg string A custom error message to use.

_addEvent() protected method

Stub to be overridden in the child class.
protected _addEvent ( Kronolith_Event $event )
$event Kronolith_Event

_addTags() protected method

Helper function to add tags from a newly creted event to the tagger.
protected _addTags ( Kronolith_Event $event )
$event Kronolith_Event The event to save tags to storage for.

_deleteEvent() protected method

Stub to be overridden in the child class.
protected _deleteEvent ( mixed $eventId ) : Kronolith_Event
$eventId mixed Either the event id to delete, or the event object.
return Kronolith_Event Returns the deleted event.

_handleNotifications() protected method

Wrapper for sending notifications, so that we can overwrite this action in Kronolith_Driver_Resource.
protected _handleNotifications ( Kronolith_Event $event, string $action )
$event Kronolith_Event
$action string

_listEvents() protected method

Stub to be overridden in concrete class.
protected _listEvents ( Horde_Date $startDate = null, Horde_Date $endDate = null, array $options = [] )
$startDate Horde_Date The start of range date.
$endDate Horde_Date The end of date range.
$options 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)

_move() protected method

Stub to be overridden in the child class.
protected _move ( $eventId, $newCalendar )

_updateEvent() protected method

Stub to be overridden in the child class.
protected _updateEvent ( Kronolith_Event $event )
$event Kronolith_Event

_updateTags() protected method

Helper function to update an existing event's tags to tagger storage.
protected _updateTags ( Kronolith_Event $event )
$event Kronolith_Event The event to update

backgroundColor() public method

Returns the background color of the current calendar.
public backgroundColor ( ) : string
return string The calendar color.

colors() public method

Returns the colors of the current calendar.
public colors ( ) : array
return array The calendar background and foreground color.

countEvents() public method

Returns the number of events in the current calendar.
public countEvents ( ) : integer
return integer The number of events.

delete() public method

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

deleteEvent() public method

Deletes an event.
public deleteEvent ( mixed $eventId, boolean $silent = false )
$eventId mixed Either the event id to delete, or the event object.
$silent boolean Don't send notifications, used when deleting events in bulk from maintenance tasks.

exists() public method

Stub for child class to override if it can implement.
public exists ( $uid, $calendar_id = null )

filterEventsByCalendar() public method

Stub to be overridden in the child class if it can implement.
public filterEventsByCalendar ( $uids, $calendar )

getByUID() public method

Stub to be overridden in the child class.
public getByUID ( $uid, $calendars = null, $getAll = false )

getEvent() public method

Stub to be overridden in the child class.
public getEvent ( $eventId = null )

getParam() public method

Returns a configuration for this driver.
public getParam ( string $param ) : mixed
$param string A parameter name.
return mixed The parameter value or null if not set.

initialize() public method

Stub to initiate a driver.
public initialize ( )

listAlarms() public method

Stub to be overridden in the child class.
public listAlarms ( $date, $fullevent = false )

listEvents() public method

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 $options = [] )
$startDate Horde_Date The start of range date.
$endDate Horde_Date The end of date range.
$options 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)

move() public method

Moves an event to a new calendar.
public move ( string $eventId, string $newCalendar )
$eventId string The event to move.
$newCalendar string The new calendar.

nextRecurrence() public method

Finds the next recurrence of $eventId that's after $afterDate.
public nextRecurrence ( string $eventId, Horde_Date $afterDate ) : Horde_Date | boolean
$eventId string The ID of the event to fetch.
$afterDate Horde_Date Return events after this date.
return Horde_Date | boolean The date of the next recurrence or false if the event does not recur after $afterDate.

open() public method

Selects a calendar as the currently opened calendar.
public open ( string $calendar )
$calendar string A calendar identifier.

removeUserData() public method

Stub for child class to override if it can implement.
Deprecation: Now lives in Kronolith_Application::
public removeUserData ( $user )

saveEvent() public method

If it is a new event, it is added, otherwise the event is updated.
public saveEvent ( Kronolith_Event $event ) : string
$event Kronolith_Event The event to save.
return string The event id.

setParam() public method

Sets a configuration for this driver.
public setParam ( string $param, mixed $value )
$param string A parameter name.
$value mixed The parameter value.

setParams() public method

Sets all configuration parameters for this driver.
public setParams ( string $params )
$params string A parameters hash.

supportsTimezones() public method

Returns whether this driver supports per-event timezones.
public supportsTimezones ( ) : boolean
return boolean Whether this drivers suppports per-event timezones.

synchronize() public method

Synchronize if driver needs to.
public synchronize ( boolean $force = false, string $token = false )
$force boolean If true, forces synchronization, even if we have already done so.
$token string A synchroniziation token, if available.

Property Details

$_params protected_oe property

A hash containing any parameters for the current driver.
protected array $_params
return array

$backgroundColor public_oe property

The HTML background color to be used for this event.
public string $backgroundColor
return string

$calendar public_oe property

The current calendar.
public string $calendar
return string

$foregroundColor public_oe property

The HTML foreground color to be used for this event.
public string $foregroundColor
return string