Class Horde_Alarm_sql

Description

The Horde_Alarm_sql:: class is a Horde_Alarm storage implementation using the PEAR DB package.

Required values for $params:

      'phptype'       The database type (e.g. 'pgsql', 'mysql', etc.).
      'charset'       The database's internal charset.

Optional values for $params:

      'table'         The name of the foo table in 'database'.

 Required by some database implementations:
      'database'      The name of the database.
      'hostspec'      The hostname of the database server.
      'protocol'      The communication protocol ('tcp', 'unix', etc.).
      'username'      The username with which to connect to the database.
      'password'      The password associated with 'username'.
      'options'       Additional options to pass to the database.
      'tty'           The TTY on which to connect to the database.
      'port'          The port on which to connect to the database.

The table structure can be created by the scripts/sql/horde_alarm.sql script.

Located in /Alarm/Alarm/sql.php (line 41)

Horde_Alarm
   |
   --Horde_Alarm_sql
Variable Summary
Method Summary
 Horde_Alarm_sql Horde_Alarm_sql ([array $params = array()])
 boolean initialize ()
 void _add (array $alarm)
 void _delete (string $id, [string $user = null])
 void _dismiss (string $id, string $user)
 boolean _exists (string $id, string $user)
 array _fetchAlarms (DB_result $result)
 mixed _fromDriver (mixed $value)
 void _gc ()
 array _get (string $id, string $user)
 array _global ()
 void _initConn ( &$db)
 void _internal (string $id, string $user, array $internal)
 boolean _isSnoozed (string $id, string $user, Horde_Date $time)
 array _list (string $user, Horde_Date $time)
 void _snooze (string $id, string $user, Horde_Date $snooze)
 mixed _toDriver (mixed $value)
 void _update (array $alarm)
Variables
DB $_db (line 48)

Handle for the current database connection.

DB $_write_db (line 56)

Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.

Inherited Variables

Inherited from Horde_Alarm

Horde_Alarm::$_errormsg
Horde_Alarm::$_params
Methods
Constructor Horde_Alarm_sql (line 63)

Constructs a new SQL storage object.

Horde_Alarm_sql Horde_Alarm_sql ([array $params = array()])
  • array $params: A hash containing connection parameters.
initialize (line 425)

Attempts to open a connection to the SQL server.

  • return: True on success, PEAR_Error on failure.
boolean initialize ()
_add (line 218)

Adds an alarm hash to the backend.

void _add (array $alarm)
  • array $alarm: An alarm hash.

Redefinition of:
Horde_Alarm::_add()
_delete (line 385)

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.

Redefinition of:
Horde_Alarm::_delete()
_dismiss (line 341)

Dismisses an alarm.

void _dismiss (string $id, string $user)
  • string $id: The alarm's unique id.
  • string $user: The alarm's user
_exists (line 299)

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

Redefinition of:
Horde_Alarm::_exists()
_fetchAlarms (line 189)

Fetches all alarms from a DB result set.

  • return: A list of alarm hashes.
array _fetchAlarms (DB_result $result)
  • DB_result $result: A DB result set.
_fromDriver (line 75)

Converts a value from the driver's charset.

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

Redefinition of:
Horde_Alarm::_fromDriver()
Converts a value from the driver's charset.
_gc (line 407)

Garbage collects old alarms in the backend.

void _gc ()
_get (line 100)

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

Redefinition of:
Horde_Alarm::_get()
_global (line 167)

Returns a list of all global alarms from the backend.

  • return: A list of alarm hashes.
array _global ()
_initConn (line 475)
void _initConn ( &$db)
  • &$db
_internal (line 276)

Updates internal alarm properties, i.e. properties not determined by the application setting the alarm.

void _internal (string $id, string $user, array $internal)
  • string $id: The alarm's unique id.
  • string $user: The alarm's user
  • array $internal: A hash with the internal data.

Redefinition of:
Horde_Alarm::_internal()
_isSnoozed (line 365)

Returns whether an alarm is snoozed.

  • return: True if the alarm is snoozed.
boolean _isSnoozed (string $id, string $user, Horde_Date $time)
  • string $id: The alarm's unique id.
  • string $user: The alarm's user
  • Horde_Date $time: The time when the alarm may be snoozed.

Redefinition of:
Horde_Alarm::_isSnoozed()
_list (line 138)

Returns a list of alarms from the backend.

  • return: A list of alarm hashes.
array _list (string $user, Horde_Date $time)
  • Horde_Date $time: The time when the alarms should be active.
  • string $user: Return alarms for this user, all users if null, or global alarms if empty.

Redefinition of:
Horde_Alarm::_list()
_snooze (line 320)

Delays (snoozes) an alarm for a certain period.

void _snooze (string $id, string $user, Horde_Date $snooze)
  • string $id: The alarm's unique id.
  • string $user: The alarm's user
  • Horde_Date $snooze: The snooze time.

Redefinition of:
Horde_Alarm::_snooze()
_toDriver (line 87)

Converts a value to the driver's charset.

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

Redefinition of:
Horde_Alarm::_toDriver()
Converts a value to the driver's charset.
_update (line 244)

Updates an alarm hash in the backend.

void _update (array $alarm)
  • array $alarm: An alarm hash.

Redefinition of:
Horde_Alarm::_update()

Inherited Methods

Inherited From Horde_Alarm

 Horde_Alarm::Horde_Alarm()
 Horde_Alarm::delete()
 Horde_Alarm::exists()
 Horde_Alarm::factory()
 Horde_Alarm::gc()
 Horde_Alarm::get()
 Horde_Alarm::globalAlarms()
 Horde_Alarm::isSnoozed()
 Horde_Alarm::listAlarms()
 Horde_Alarm::load()
 Horde_Alarm::notificationMethods()
 Horde_Alarm::notify()
 Horde_Alarm::set()
 Horde_Alarm::snooze()
 Horde_Alarm::_add()
 Horde_Alarm::_delete()
 Horde_Alarm::_exists()
 Horde_Alarm::_fromDriver()
 Horde_Alarm::_get()
 Horde_Alarm::_internal()
 Horde_Alarm::_isSnoozed()
 Horde_Alarm::_list()
 Horde_Alarm::_mail()
 Horde_Alarm::_notify()
 Horde_Alarm::_popup()
 Horde_Alarm::_sms()
 Horde_Alarm::_snooze()
 Horde_Alarm::_toDriver()
 Horde_Alarm::_update()

Documentation generated on Sun, 30 Jan 2011 05:21:58 +0000 by phpDocumentor 1.4.3