Class Horde_Alarm

Description

The Horde_Alarm:: class provides an interface to deal with reminders, alarms and notifications through a standardized API.

Alarm hashes have the following fields:

  • id: Unique alarm id.
  • user: The alarm's user. Empty if a global alarm.
  • start: The alarm start as a Horde_Date.
  • end: The alarm end as a Horde_Date.
  • methods: The notification methods for this alarm.
  • params: The paramters for the notification methods.
  • title: The alarm title.
  • text: An optional alarm description.
  • snooze: The snooze time (next time) of the alarm as a Horde_Date.
  • internal: Holds internally used data.

Located in /Alarm/Alarm.php (line 36)


	
			
Direct descendents
Class Description
 class Horde_Alarm_sql The Horde_Alarm_sql:: class is a Horde_Alarm storage implementation using the PEAR DB package.
Variable Summary
 string $_errormsg
 array $_params
Method Summary
 Horde_Alarm Horde_Alarm ([array $params = array()], [ $errormsg = null])
 void delete (string $id, [string $user = null])
 boolean exists (string $id, string $user)
 mixed factory ([string $driver = null], [array $params = null])
 void gc ()
 array get (string $id, string $user)
 array globalAlarms ()
 boolean isSnoozed (string $id, string $user, [Horde_Date $time = null])
 array listAlarms ([string $user = null], [Horde_Date $time = null], [boolean $load = false], [boolean $preload = true])
 void load ([string $user = null], [boolean $preload = true])
 void notify ([string $user = null], [boolean $load = true], [boolean $preload = true], [array $exclude = array()])
 void set (array $alarm)
 void snooze (string $id, string $user, integer $minutes)
 void _add ()
 void _delete ()
 void _exists ()
 mixed _fromDriver (mixed $value)
 void _get ()
 void _internal ()
 void _isSnoozed ()
 void _list ()
 void _mail (array $alarm)
 void _notify (array $alarm)
 void _popup (array $alarm)
 void _sms (array $alarm)
 void _snooze ()
 mixed _toDriver (mixed $value)
 void _update ()
Variables
string $_errormsg (line 50)

An error message to throw when something is wrong.

array $_params = array('ttl' => 300) (line 43)

Hash containing connection parameters.

Methods
Constructor Horde_Alarm (line 58)

Constructor - just store the $params in our newly-created object. All other work is done by initialize().

Horde_Alarm Horde_Alarm ([array $params = array()], [ $errormsg = null])
  • array $params: Any parameters needed for this driver.
  • $errormsg
delete (line 174)

Deletes an alarm from the backend.

void delete (string $id, [string $user = null])
  • string $id: The alarm's unique id.
  • string $user: The alarm's user. All users' alarms if null.
exists (line 115)

Returns whether an alarm with the given id exists already.

  • return: True if the specified alarm exists.
boolean exists (string $id, string $user)
  • string $id: The alarm's unique id.
  • string $user: The alarm's user
factory (line 523)

Attempts to return a concrete Horde_Alarm instance based on $driver.

  • return: The newly created concrete Horde_Alarm instance, or false on an error.
mixed factory ([string $driver = null], [array $params = null])
  • string $driver: The type of concrete Horde_Alarm subclass to return. The class name is based on the storage driver ($driver). The code is dynamically included.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
gc (line 500)

Garbage collects old alarms in the backend.

void gc ()
get (line 76)

Returns an alarm hash from the backend.

  • return: An alarm hash.
array get (string $id, string $user)
  • string $id: The alarm's unique id.
  • string $user: The alarm's user
globalAlarms (line 293)

Returns a list of all global alarms from the backend.

  • return: A list of alarm hashes.
array globalAlarms ()
isSnoozed (line 160)

Returns whether an alarm is snoozed.

  • return: True if the alarm is snoozed.
boolean isSnoozed (string $id, string $user, [Horde_Date $time = null])
  • string $id: The alarm's unique id.
  • string $user: The alarm's user
  • Horde_Date $time: The time when the alarm may be snoozed. Defaults to now.
listAlarms (line 265)

Returns a list of alarms from the backend.

  • return: A list of alarm hashes.
array listAlarms ([string $user = null], [Horde_Date $time = null], [boolean $load = false], [boolean $preload = true])
  • string $user: Return alarms for this user, all users if null, or global alarms if empty.
  • Horde_Date $time: The time when the alarms should be active. Defaults to now.
  • boolean $load: Update active alarms from all applications?
  • boolean $preload: Preload alarms that go off within the next ttl time span?
load (line 191)

Retrieves active alarms from all applications and stores them in the backend.

The applications will only be called once in the configured time span, by default 5 minutes.

void load ([string $user = null], [boolean $preload = true])
  • string $user: Retrieve alarms for this user, or for all users if null.
  • boolean $preload: Preload alarms that go off within the next ttl time span?
notificationMethods (line 467)

Returns a list of available notification methods and method parameters.

The returned list is a hash with method names as the keys and optionally associated parameters as values. The parameters are hashes again with parameter names as keys and parameter information as values. The parameter information is hash with the following keys: 'desc' contains a parameter description; 'required' specifies whether this parameter is required.

  • return: List of methods and parameters.
array notificationMethods ()
notify (line 318)

Notifies the user about any active alarms.

void notify ([string $user = null], [boolean $load = true], [boolean $preload = true], [array $exclude = array()])
  • string $user: Notify this user, all users if null, or guest users if empty.
  • boolean $load: Update active alarms from all applications?
  • boolean $preload: Preload alarms that go off within the next ttl time span?
  • array $exclude: Don't notify with these methods.
set (line 95)

Stores an alarm hash in the backend.

The alarm will be added if it doesn't exist, and updated otherwise.

void set (array $alarm)
  • array $alarm: An alarm hash.
snooze (line 129)

Delays (snoozes) an alarm for a certain period.

void snooze (string $id, string $user, integer $minutes)
  • string $id: The alarm's unique id.
  • string $user: The notified user.
  • integer $minutes: The delay in minutes. A negative value dismisses the alarm completely.
_add (line 597)
  • abstract:
void _add ()

Redefined in descendants as:
_delete (line 645)
  • abstract:
void _delete ()

Redefined in descendants as:
_exists (line 621)
  • abstract:
void _exists ()

Redefined in descendants as:
_fromDriver (line 561)

Converts a value from the driver's charset.

  • return: Converted value.
mixed _fromDriver (mixed $value)
  • mixed $value: Value to convert.

Redefined in descendants as:
_get (line 581)
  • abstract:
void _get ()

Redefined in descendants as:
_internal (line 613)
  • abstract:
void _internal ()

Redefined in descendants as:
_isSnoozed (line 637)
  • abstract:
void _isSnoozed ()

Redefined in descendants as:
_list (line 589)
  • abstract:
void _list ()

Redefined in descendants as:
_mail (line 411)

Notifies about an alarm by email.

void _mail (array $alarm)
  • array $alarm: An alarm hash.
_notify (line 349)

Notifies about an alarm through Horde_Notification.

void _notify (array $alarm)
  • array $alarm: An alarm hash.
_popup (line 397)

Notifies about an alarm by a javascript popup.

void _popup (array $alarm)
  • array $alarm: An alarm hash.
_sms (line 451)

Notifies about an alarm with an SMS through the sms/send API method.

void _sms (array $alarm)
  • array $alarm: An alarm hash.
_snooze (line 629)
  • abstract:
void _snooze ()

Redefined in descendants as:
_toDriver (line 573)

Converts a value to the driver's charset.

  • return: Converted value.
mixed _toDriver (mixed $value)
  • mixed $value: Value to convert.

Redefined in descendants as:
_update (line 605)
  • abstract:
void _update ()

Redefined in descendants as:

Documentation generated on Sun, 30 Jan 2011 05:15:03 +0000 by phpDocumentor 1.4.3