forked from horde/horde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kolab.php
155 lines (145 loc) · 4.13 KB
/
Kolab.php
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
<?php
/**
* The backend for Kolab resources.
*
* PHP version 5
*
* @category Kolab
* @package Kolab_FreeBusy
* @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_FreeBusy
*/
/**
* The backend for Kolab resources.
*
* Copyright 2004-2008 Klarälvdalens Datakonsult AB
* Copyright 2008-2014 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.
*
* @category Kolab
* @package Kolab_FreeBusy
* @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_FreeBusy
*/
class Horde_Kolab_FreeBusy_Resource_Kolab
implements Horde_Kolab_FreeBusy_Resource
{
/**
* The link to the folder.
*
* @var Horde_Kolab_Storage_Folder
*/
private $_folder;
/**
* The folder owner.
*
* @var Horde_Kolab_FreeBusy_Owner_Freebusy
*/
protected $_owner;
/**
* Constructor.
*
* @param Horde_Kolab_Storage_Folder $folder The storage folder
* representing this
* resource.
* @param Horde_Kolab_FreeBusy_Owner_Freebusy $owner The resource owner.
*/
public function __construct(
Horde_Kolab_Storage_Folder $folder,
Horde_Kolab_FreeBusy_Owner $owner
) {
$this->_folder = $folder;
$this->_owner = $owner;
}
/**
* Return the owner of the resource.
*
* @return Horde_Kolab_FreeBusy_Owner The resource owner.
*/
public function getOwner()
{
return $this->_owner;
}
/**
* Return the name of the resource.
*
* @return string The name for the resource.
*/
public function getName()
{
return $this->_folder->getName();
}
/**
* Return the folder represented by this resource.
*
* @return Horde_Kolab_Storage_Folder The folder.
*/
protected function getFolder()
{
return $this->_folder;
}
/**
* Return the data represented by this resource.
*
* @return Horde_Kolab_Storage_Data The data.
*/
protected function getData()
{
return $this->_folder->getData();
}
/**
* Return for whom this resource exports relevant data.
*
* @return string The user type the exported data of this resource is
* relevant for.
*
* @throws Horde_Kolab_FreeBusy_Exception If retrieving the relevance
* information failed.
*
* @todo It would be nice if we would not only have the free/busy specific
* relevance but a generic way of setting the relevance of resources.
*/
public function getRelevance()
{
throw new Horde_Kolab_FreeBusy_Exception(
'There is no generic definition for relevance available!'
);
}
/**
* Fetch the resource ACL.
*
* @return array ACL for this resource.
*
* @throws Horde_Kolab_FreeBusy_Exception If retrieving the ACL information
* failed.
*/
public function getAcl()
{
$perm = $this->_folder->getPermission();
$acl = &$perm->acl;
return $acl;
}
/**
* Fetch the access controls on specific attributes of this
* resource.
*
* @return array Attribute ACL for this resource.
*
* @throws Horde_Kolab_FreeBusy_Exception If retrieving the attribute ACL
* information failed.
*
* @todo It would be nice if we would not only have the free/busy specific
* attribute acls but a generic way of setting attribute ACL for resources.
*/
public function getAttributeAcl()
{
throw new Horde_Kolab_FreeBusy_Exception(
'There is no generic definition for attribute ACL available!'
);
}
}