1: <?php
2: /**
3: * Logs exporting free/busy data.
4: *
5: * PHP version 5
6: *
7: * @category Kolab
8: * @package Kolab_FreeBusy
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://pear.horde.org/index.php?package=Kolab_FreeBusy
12: */
13:
14: /**
15: * Logs exporting free/busy data.
16: *
17: * Copyright 2009-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If
20: * you did not receive this file, see
21: * http://www.horde.org/licenses/lgpl21.
22: *
23: * @category Kolab
24: * @package Kolab_FreeBusy
25: * @author Gunnar Wrobel <wrobel@pardus.de>
26: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
27: * @link http://pear.horde.org/index.php?package=Kolab_FreeBusy
28: */
29: class Horde_Kolab_FreeBusy_Export_Freebusy_Decorator_Log
30: {
31: /**
32: * The decorated exporter.
33: *
34: * @var Horde_Kolab_FreeBusy_Export_Freebusy_Interface
35: */
36: private $_export;
37:
38: /**
39: * The logger.
40: *
41: * @var mixed
42: */
43: private $_logger;
44:
45: /**
46: * Constructor.
47: *
48: * @param Horde_Kolab_FreeBusy_Export_Freebusy_Interface $export The decorated
49: * export.
50: * @param mixed $logger The log handler. The
51: * class must at least
52: * provide the debug()
53: * method.
54: */
55: public function __construct(
56: Horde_Kolab_FreeBusy_Export_Freebusy_Interface $export,
57: $logger
58: ) {
59: $this->_export = $export;
60: $this->_logger = $logger;
61: }
62:
63: public function export()
64: {
65: $this->_logger->debug(
66: sprintf('Exporting free/busy data for resource %s from %s to %s',
67: $this->_export->getResourceName(),
68: $this->_export->getStart()->timestamp(),
69: $this->_export->getEnd()->timestamp()
70: )
71: );
72:
73: return $this->_export->export();
74: }
75:
76: }