1: <?php
2: /**
3: * Configured event status to free/busy status mapper.
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: * Configured event status to free/busy status mapper.
16: *
17: * Copyright 2011 Kolab Systems AG
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you did not
20: * 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_Freebusy_Helper_StatusMap_Config
30: extends Horde_Kolab_FreeBusy_Freebusy_Helper_StatusMap_Default
31: {
32: /**
33: * The status mapping.
34: *
35: * @var array
36: */
37: private $_map;
38:
39: /**
40: * Constructor.
41: *
42: * @param array $map The status mapping.
43: */
44: public function __construct($map = array())
45: {
46: $this->_map = $map;
47: }
48:
49: /**
50: * Map the event status to a free/busy status.
51: *
52: * @param string $status The event status.
53: *
54: * @return string The corresponding free/busy status.
55: */
56: public function map($status)
57: {
58: if (isset($this->_map[$status])) {
59: return $this->_map[$status];
60: } else {
61: return parent::map($status);
62: }
63: }
64:
65: }