/usr/share/php/Horde/Kolab/Storage/Folder/Base.php is in php-horde-kolab-storage 2.0.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | <?php
/**
* The Kolab_Folder class represents an single folder in the Kolab
* backend.
*
* PHP version 5
*
* @category Kolab
* @package Kolab_Storage
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Kolab_Storage
*/
/**
* The Kolab_Folder class represents an single folder in the Kolab
* backend.
*
* Copyright 2004-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @author Stuart Binge <omicron@mighty.co.za>
* @author Gunnar Wrobel <wrobel@pardus.de>
* @author Thomas Jarosch <thomas.jarosch@intra2net.com>
* @package Kolab_Storage
*/
class Horde_Kolab_Storage_Folder_Base
implements Horde_Kolab_Storage_Folder
{
/**
* The handler for the list of folders.
*
* @var Horde_Kolab_Storage_List
*/
private $_list;
/**
* The folder path.
*
* @var string
*/
private $_path;
/**
* Additional folder information.
*
* @var array
*/
private $_data;
/**
* Constructor.
*
* @param Horde_Kolab_Storage_List_Query_List $list The query handler for
* the list of folders.
* @param string $path Path of the folder.
*/
public function __construct(Horde_Kolab_Storage_List_Query_List $list, $path)
{
$this->_list = $list;
$this->_path = $path;
}
/**
* Fetch the data array.
*
* @return NULL
*/
private function _init()
{
if ($this->_data === null) {
$this->_data = $this->_list->folderData($this->_path);
}
}
/**
* Fetch a data value.
*
* @param string $key The name of the data value to fetch.
*
* @return mixed The data value
*/
public function get($key)
{
$this->_init();
if (isset($this->_data[$key])) {
return $this->_data[$key];
}
throw new Horde_Kolab_Storage_Exception(
sprintf('No "%s" information available!', $key)
);
}
/**
* Fetch a data value and accept a missing value (represented by the return value NULL).
*
* @param string $key The name of the data value to fetch.
*
* @return mixed The data value
*/
public function getWithNull($key)
{
$this->_init();
if (isset($this->_data[$key])) {
return $this->_data[$key];
}
}
/**
* Return the storage path of the folder.
*
* @return string The storage path of the folder.
*/
public function getPath()
{
return $this->_path;
}
/**
* Return the namespace type of the folder.
*
* @return string The namespace type of the folder.
*/
public function getNamespace()
{
return $this->get('namespace');
}
/**
* Return the namespace prefix of the folder.
*
* @return string The namespace prefix of the folder.
*/
public function getPrefix()
{
return $this->get('prefix');
}
/**
* Returns a readable title for this folder.
*
* @return string The folder title.
*/
public function getTitle()
{
return $this->get('name');
}
/**
* Returns the owner of the folder.
*
* @return string The owner of this folder.
*/
public function getOwner()
{
return $this->getWithNull('owner');
}
/**
* Returns the folder path without namespace components.
*
* @return string The subpath of this folder.
*/
public function getSubpath()
{
return $this->get('subpath');
}
/**
* Returns the folder parent.
*
* @return string The parent of this folder.
*/
public function getParent()
{
return $this->get('parent');
}
/**
* Is this a default folder?
*
* @return boolean Boolean that indicates the default status.
*/
public function isDefault()
{
return $this->get('default');
}
/**
* The type of this folder.
*
* @return string The folder type.
*/
public function getType()
{
return $this->get('type');
}
}
|