IMP_Maillog_Storage_History
extends IMP_Maillog_Storage_Base
in package
Horde_History storage driver for the IMP_Maillog class.
Tags
Table of Contents
Properties
- $drivers : array<string|int, mixed>
- Mapping of driver actions -> class names.
- $_history : Horde_History
- History object.
- $_user : string
- User name.
Methods
- __construct() : mixed
- Constructor.
- deleteLogs() : mixed
- Delete log entries.
- getChanges() : array<string|int, mixed>
- Retrieve changes to the maillog since the provided timestamp.
- getLog() : array<string|int, mixed>
- Retrieve history for a message.
- isAvailable() : bool
- Is this storage driver available for the given message/log type?
- saveLog() : bool
- Store a log entry.
- _getUniqueHistoryId() : string
- Generate the unique log ID for an event.
Properties
$drivers
Mapping of driver actions -> class names.
public
static array<string|int, mixed>
$drivers
= array('forward' => 'IMP_Maillog_Log_Forward', 'mdn' => 'IMP_Maillog_Log_Mdn', 'redirect' => 'IMP_Maillog_Log_Redirect', 'reply' => 'IMP_Maillog_Log_Reply', 'reply_all' => 'IMP_Maillog_Log_Replyall', 'reply_list' => 'IMP_Maillog_Log_Replylist')
$_history
History object.
protected
Horde_History
$_history
$_user
User name.
protected
string
$_user
Methods
__construct()
Constructor.
public
__construct(Horde_History $history, string $user) : mixed
Parameters
- $history : Horde_History
-
History object.
- $user : string
-
User name.
deleteLogs()
Delete log entries.
public
deleteLogs(mixed $msgs) : mixed
Parameters
- $msgs : mixed
-
Message objects (IMP_Maillog_Message objects).
getChanges()
Retrieve changes to the maillog since the provided timestamp.
public
getChanges(mixed $ts) : array<string|int, mixed>
Parameters
- $ts : mixed
-
Timestamp.
Return values
array<string|int, mixed> —An array of messages (IMP_Maillog_Message objects) changed since the provided timestamp.
getLog()
Retrieve history for a message.
public
getLog(IMP_Maillog_Message $msg[, array<string|int, mixed> $types = array() ]) : array<string|int, mixed>
Parameters
- $msg : IMP_Maillog_Message
-
A message object.
- $types : array<string|int, mixed> = array()
-
Return only these log types (IMP_Maillog_Log_Base class names). If empty, returns all types.
Return values
array<string|int, mixed> —Array of IMP_Maillog_Log_Base objects.
isAvailable()
Is this storage driver available for the given message/log type?
public
isAvailable(IMP_Maillog_Message $msg, IMP_Maillog_Log_Base $log) : bool
Parameters
- $msg : IMP_Maillog_Message
-
A message object.
- $log : IMP_Maillog_Log_Base
-
Log entry.
Return values
bool —True if the storage driver can handle data for the given input.
saveLog()
Store a log entry.
public
saveLog(IMP_Maillog_Message $msg, IMP_Maillog_Log_Base $log) : bool
Parameters
- $msg : IMP_Maillog_Message
-
Message object.
- $log : IMP_Maillog_Log_Base
-
Log entry.
Return values
bool —True if log entry was saved.
_getUniqueHistoryId()
Generate the unique log ID for an event.
protected
_getUniqueHistoryId([mixed $msg = null ]) : string
Parameters
- $msg : mixed = null
-
An IMP_Maillog_Message object, a Message-ID, or, if null, return the parent ID.
Tags
Return values
string —The unique log ID.