Свойство | Type | Description | |
---|---|---|---|
$_errors | array | A list of errors, exceptions etc. that occured during notify() calls. | |
$_handlers | array | All registered notification handlers. | |
$_handlersLoaded | boolean | Whether handler classes have been dynamically loaded already. | |
$_loader | mixed | Alarm loader callback. | |
$_logger | Horde_Log_Logger | Logger. | |
$_params | array | Hash containing connection parameters. |
Méthode | Description | |
---|---|---|
__construct ( array $params = [] ) | Constructor. | |
addHandler ( string $name, Horde_Alarm_Handler $handler ) | Registers a notification handler. | |
delete ( string $id, string $user = null ) | Deletes an alarm from the backend. | |
exists ( string $id, string $user, string $instanceid = null ) : boolean | Returns whether an alarm with the given id exists already. | |
gc ( boolean $force = false ) | Garbage collects old alarms in the backend. | |
get ( string $id, string $user ) : array | Returns an alarm hash from the backend. | |
getErrors ( ) : array | Returns a list of errors, exceptions etc. that occured during notify() calls. | |
globalAlarms ( ) : array | Returns a list of all global alarms from the backend. | |
handlers ( ) : array | Returns a list of available notification handlers and parameters. | |
initialize ( ) | Attempts to initialize the backend. | |
internal ( string $id, string $user, array $internal ) | Updates internal alarm properties, i.e. properties not determined by the application setting the alarm. | |
isSnoozed ( string $id, string $user, Horde_Date $time = null ) : boolean | Returns whether an alarm is snoozed. | |
listAlarms ( string $user = null, Horde_Date $time = null, boolean $load = false, boolean $preload = true ) : array | Returns a list of alarms from the backend. | |
notify ( string $user = null, boolean $load = true, boolean $preload = true, array $exclude = [] ) | Notifies the user about any active alarms. | |
set ( array $alarm, boolean $keep = false ) | Stores an alarm hash in the backend. | |
snooze ( string $id, string $user, integer $minutes ) | Delays (snoozes) an alarm for a certain period. |
Méthode | Description | |
---|---|---|
_add ( array $alarm ) | Adds an alarm hash to the backend. | |
_delete ( string $id, string $user = null ) | Deletes an alarm from the backend. | |
_dismiss ( string $id, string $user ) | Dismisses an alarm. | |
_exists ( string $id, string $user, string $instanceid = null ) : boolean | Returns whether an alarm with the given id exists already. | |
_fromDriver ( mixed $value ) : mixed | Converts a value from the driver's charset. | |
_gc ( ) | Garbage collects old alarms in the backend. | |
_get ( string $id, string $user ) : array | Returns an alarm hash from the backend. | |
_global ( ) : array | Returns a list of all global alarms from the backend. | |
_isSnoozed ( string $id, string $user, Horde_Date $time ) : boolean | Returns whether an alarm is snoozed. | |
_list ( string $user, Horde_Date $time ) : array | Returns a list of alarms from the backend. | |
_snooze ( string $id, string $user, Horde_Date $snooze ) | Delays (snoozes) an alarm for a certain period. | |
_toDriver ( mixed $value ) : mixed | Converts a value to the driver's charset. | |
_update ( array $alarm, boolean $keepsnooze = false ) | Updates an alarm hash in the backend. |
public __construct ( array $params = [] ) | ||
$params | array | Configuration parameters:
'logger' - (Horde_Log_Logger) A logger instance. 'ttl' - (integer) Time to live value, in seconds. |
abstract protected _fromDriver ( mixed $value ) : mixed | ||
$value | mixed | Value to convert. |
Résultat | mixed | Converted value. |
abstract protected _gc ( ) |
public addHandler ( string $name, Horde_Alarm_Handler $handler ) | ||
$name | string | A handler name. |
$handler | Horde_Alarm_Handler | A notification handler. |
public get ( string $id, string $user ) : array | ||
$id | string | The alarm's unique id. |
$user | string | The alarm's user |
Résultat | array | 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) |
public globalAlarms ( ) : array | ||
Résultat | array | A list of alarm hashes. |
abstract public initialize ( ) |
public listAlarms ( string $user = null, Horde_Date $time = null, boolean $load = false, boolean $preload = true ) : array | ||
$user | string | Return alarms for this user, all users if null, or global alarms if empty. |
$time | Horde_Date | The time when the alarms should be active. Defaults to now. |
$load | boolean | Update active alarms from all applications? |
$preload | boolean | Preload alarms that go off within the next ttl time span? |
Résultat | array | A list of alarm hashes. |
public notify ( string $user = null, boolean $load = true, boolean $preload = true, array $exclude = [] ) | ||
$user | string | Notify this user, all users if null, or guest users if empty. |
$load | boolean | Update active alarms from all applications? |
$preload | boolean | Preload alarms that go off within the next ttl time span? |
$exclude | array | Don't notify with these methods. |
protected array $_errors | ||
Résultat | array |
protected array $_handlers | ||
Résultat | array |
protected bool $_handlersLoaded | ||
Résultat | boolean |
protected Horde_Log_Logger $_logger | ||
Résultat | Horde_Log_Logger |
protected array $_params | ||
Résultat | array |