1: <?php
2: /**
3: * Copyright 2014 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @category Horde
9: * @copyright 2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * Abstract storage driver for the IMP_Maillog class.
16: *
17: * @author Michael Slusarz <slusarz@horde.org>
18: * @category Horde
19: * @copyright 2014 Horde LLC
20: * @license http://www.horde.org/licenses/gpl GPL
21: * @package IMP
22: */
23: abstract class IMP_Maillog_Storage_Base
24: {
25: /**
26: * Store a log entry.
27: *
28: * @param IMP_Maillog_Message $msg Message object.
29: * @param IMP_Maillog_Log_Base $log Log entry.
30: *
31: * @return boolean True if log entry was saved.
32: */
33: abstract public function saveLog(
34: IMP_Maillog_Message $msg, IMP_Maillog_Log_Base $log
35: );
36:
37: /**
38: * Retrieve history for a message.
39: *
40: * @param IMP_Maillog_Message $msg A message object.
41: * @param array $filter Filter these actions.
42: *
43: * @return array Array of IMP_Maillog_Log_Base objects.
44: */
45: abstract public function getLog(
46: IMP_Maillog_Message $msg, array $filter = array()
47: );
48:
49: /**
50: * Delete log entries.
51: *
52: * @param array $msgs Message objects (IMP_Maillog_Message objects).
53: */
54: abstract public function deleteLogs(array $msgs);
55:
56: /**
57: * Retrieve changes to the maillog since the provided timestamp.
58: *
59: * @param integer $ts Timestamp.
60: *
61: * @return array An array of messages (IMP_Maillog_Message objects)
62: * changed since the provided timestamp.
63: */
64: abstract public function getChanges($ts);
65:
66: }
67: