$_logger
$_logger : \Horde_Log_Logger
Logger.
The Horde_Alarm class provides an interface to deal with reminders, alarms and notifications through a standardized API.
listAlarms(string $user = null, \Horde_Date $time = null, boolean $load = false, boolean $preload = true) : array
Returns a list of alarms from the backend.
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? |
A list of alarm hashes.
get(string $id, string $user) : array
Returns an alarm hash from the backend.
string | $id | The alarm's unique id. |
string | $user | The alarm's user |
An alarm hash. Contains the following:
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. instanceid: Holds an instance identifier for recurring alarms. (@since 2.2.0)
set(array $alarm, boolean $keep = false)
Stores an alarm hash in the backend.
The alarm will be added if it doesn't exist, and updated otherwise.
array | $alarm | An alarm hash. See self::get() for format. |
boolean | $keep | Whether to keep the snooze value and notification status unchanged. If true, the alarm will get "un-snoozed", and notifications (like mails) are sent again. |
internal(string $id, string $user, array $internal)
Updates internal alarm properties, i.e. properties not determined by the application setting the alarm.
string | $id | The alarm's unique id. |
string | $user | The alarm's user |
array | $internal | A hash with the internal data. |
exists(string $id, string $user, string $instanceid = null) : boolean
Returns whether an alarm with the given id exists already.
string | $id | The alarm's unique id. |
string | $user | The alarm's user |
string | $instanceid | An optional instanceid to check for. @since 2.2.0 |
True if the specified alarm exists.
snooze(string $id, string $user, integer $minutes)
Delays (snoozes) an alarm for a certain period.
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. |
isSnoozed(string $id, string $user, \Horde_Date $time = null) : boolean
Returns whether an alarm is snoozed.
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. |
True if the alarm is snoozed.
notify(string $user = null, boolean $load = true, boolean $preload = true, array $exclude = array())
Notifies the user about any active alarms.
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. |
if loading of alarms fails, but not if notifying of individual alarms fails.
addHandler(string $name, \Horde_Alarm_Handler $handler)
Registers a notification handler.
string | $name | A handler name. |
\Horde_Alarm_Handler | $handler | A notification handler. |
handlers() : array
Returns a list of available notification handlers and 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.
List of methods and parameters.
_list(string $user, \Horde_Date $time) : array
Returns a list of alarms from the backend.
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. |
A list of alarm hashes.
_exists(string $id, string $user, string $instanceid = null) : boolean
Returns whether an alarm with the given id exists already.
string | $id | The alarm's unique id. |
string | $user | The alarm's user |
string | $instanceid | An optional instanceid to match. |
True if the specified alarm exists.
_isSnoozed(string $id, string $user, \Horde_Date $time) : boolean
Returns whether an alarm is snoozed.
string | $id | The alarm's unique id. |
string | $user | The alarm's user |
\Horde_Date | $time | The time when the alarm may be snoozed. |
True if the alarm is snoozed.