1: <?php
2: /**
3: * Handles folder types.
4: *
5: * PHP version 5
6: *
7: * @category Kolab
8: * @package Kolab_Storage
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_Storage
12: */
13:
14: /**
15: * Handles folder types.
16: *
17: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you
20: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
21: *
22: * @category Kolab
23: * @package Kolab_Storage
24: * @author Gunnar Wrobel <wrobel@pardus.de>
25: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
26: * @link http://pear.horde.org/index.php?package=Kolab_Storage
27: */
28: class Horde_Kolab_Storage_Folder_Type
29: {
30: /**
31: * Folder type.
32: *
33: * @var string
34: */
35: private $_type;
36:
37: /**
38: * Default folder?
39: *
40: * @var boolean
41: */
42: private $_default;
43:
44: /**
45: * Constructor.
46: *
47: * @param string $annotation The folder type annotation value.
48: */
49: public function __construct($annotation)
50: {
51: $elements = explode('.', $annotation);
52: $this->_type = $elements[0];
53: $this->_default = isset($elements[1]) && $elements[1] == 'default';
54: }
55:
56: /**
57: * Return the folder type.
58: *
59: * @return string The folder type.
60: */
61: public function getType()
62: {
63: return $this->_type;
64: }
65:
66: /**
67: * Indicates if this is a default folder.
68: *
69: * @return boolean True if it is a default folder.
70: */
71: public function isDefault()
72: {
73: return $this->_default;
74: }
75: }