1<?php
2/**
3 * Copyright 2014-2017 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-2017 Horde LLC
10 * @license   http://www.horde.org/licenses/gpl GPL
11 * @package   IMP
12 */
13
14/**
15 * Redirect log entry.
16 *
17 * @author    Michael Slusarz <slusarz@horde.org>
18 * @category  Horde
19 * @copyright 2014-2017 Horde LLC
20 * @license   http://www.horde.org/licenses/gpl GPL
21 * @package   IMP
22 *
23 * @property-read string $recipients  List of recipients.
24 */
25class IMP_Maillog_Log_Redirect extends IMP_Maillog_Log_Base
26{
27    /**
28     */
29    protected $_action = 'redirect';
30
31    /**
32     * List of recipients.
33     *
34     * @var string
35     */
36    protected $_recipients;
37
38    /**
39     * Constructor.
40     *
41     * @param string $recipients  Recipient list.
42     */
43    public function __construct($recipients)
44    {
45        $this->_recipients = strval($recipients);
46    }
47
48    /**
49     */
50    public function __get($name)
51    {
52        switch ($name) {
53        case 'recipients':
54            return $this->_recipients;
55        }
56
57        return parent::__get($name);
58    }
59
60    /**
61     */
62    protected function _getMessage()
63    {
64        return sprintf(
65            _("You redirected this message on %s to: %s."),
66            $this->date,
67            $this->recipients
68        );
69    }
70
71}
72