The Kronolith_Driver_Sql class implements the Kronolith_Driver API for a
SQL backend.
Copyright 1999-2012 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.
Methods summary
public
string
|
#
backgroundColor( )
Returns the background color of the current calendar.
Returns the background color of the current calendar.
Returns
string The calendar color.
Overrides
|
public
array
|
#
listAlarms( Horde_Date $date, boolean $fullevent = false )
Parameters
- $date
- The date to list alarms for
- $fullevent
- Return the full event objects?
Returns
array An array of event ids, or Kronolith_Event objects
Throws
Overrides
|
public
mixed
|
#
search( object $query, boolean $json = false )
Searches a calendar.
Parameters
- $query
- An object with the criteria to search for.
- $json
- Store the results of the events' toJson() method?
Returns
mixed An array of Kronolith_Events.
Throws
Overrides
|
public
string|boolean
|
#
exists( string $uid, string $calendar_id = null )
Checks if the event's UID already exists and returns all event
ids with that UID.
Checks if the event's UID already exists and returns all event
ids with that UID.
Parameters
- $uid
- The event's uid.
- $calendar_id
- Calendar to search in.
Returns
string|boolean Returns a string with event_id or false if
not found.
Throws
Overrides
|
public
array
|
#
listEvents( Horde_Date $startDate = null, Horde_Date $endDate = null, boolean $showRecurrence = false, boolean $hasAlarm = false, boolean $json = false, boolean $coverDates = true, boolean $hideExceptions = false, boolean $fetchTags = false )
Lists all events in the time range, optionally restricting results to
only events with alarms.
Lists all events in the time range, optionally restricting results to
only events with alarms.
Parameters
- $startDate
- Start of range date object.
- $endDate
- End of range data object.
- $showRecurrence
- <p>Return every instance of a recurring
event? If false, will only return
recurring events once inside the
$startDate - $endDate range.</p>
- $hasAlarm
- Only return events with alarms?
- $json
- <p>Store the results of the events'
toJson() method?</p>
- $coverDates
- <p>Whether to add the events to all days
that they cover.</p>
- $hideExceptions
- <p>Hide events that represent exceptions
to a recurring event (baseid is set)?</p>
- $fetchTags
- Whether to fetch tags for all events
Returns
array Events in the given time range.
Throws
Overrides
|
public
integer
|
#
countEvents( )
Returns the number of events in the current calendar.
Returns the number of events in the current calendar.
Returns
integer The number of events.
Throws
Overrides
|
public
|
|
public
Kronolith_Event
|
#
getByUID( string $uid, array $calendars = null, boolean $getAll = false )
Get an event or events with the given UID value.
Get an event or events with the given UID value.
Parameters
- $uid
- The UID to match
- $calendars
- A restricted array of calendar ids to search
- $getAll
- Return all matching events?
Returns
Throws
Overrides
|
public
|
#
delete( string $calendar )
Delete a calendar and all its events.
Delete a calendar and all its events.
Parameters
- $calendar
- The name of the calendar to delete.
Throws
Overrides
|
public
|
#
deleteEvent( string $eventId, boolean $silent = false )
Delete an event.
Parameters
- $eventId
- The ID of the event to delete.
- $silent
- <p>Don't send notifications, used when deleting
events in bulk from maintenance tasks.</p>
Throws
Overrides
|
public
array
|
#
filterEventsByCalendar( array $uids, array $calendar )
Filters a list of events to return only those that belong to certain
calendars.
Filters a list of events to return only those that belong to certain
calendars.
Parameters
- $uids
- A list of event UIDs.
- $calendar
- A list of calendar IDs.
Returns
array Event UIDs filtered by calendar IDs.
Throws
Overrides
|
public
|
#
initialize( )
Attempts to open a connection to the SQL server.
Attempts to open a connection to the SQL server.
Throws
Overrides
|
public
mixed
|
#
convertFromDriver( mixed $value )
Converts a value from the driver's charset to the default
charset.
Converts a value from the driver's charset to the default
charset.
Parameters
- $value
- A value to convert.
Returns
mixed The converted value.
|
public
mixed
|
#
convertToDriver( mixed $value )
Converts a value from the default charset to the driver's
charset.
Converts a value from the default charset to the driver's
charset.
Parameters
- $value
- A value to convert.
Returns
mixed The converted value.
|