1 | <?php |
||
34 | class AddressBookImpl implements IAddressBook { |
||
35 | |||
36 | /** @var CardDavBackend */ |
||
37 | private $backend; |
||
38 | |||
39 | /** @var array */ |
||
40 | private $addressBookInfo; |
||
41 | |||
42 | /** @var AddressBook */ |
||
43 | private $addressBook; |
||
44 | |||
45 | /** |
||
46 | * AddressBookImpl constructor. |
||
47 | * |
||
48 | * @param AddressBook $addressBook |
||
49 | * @param array $addressBookInfo |
||
50 | * @param CardDavBackend $backend |
||
51 | */ |
||
52 | public function __construct( |
||
61 | |||
62 | /** |
||
63 | * @return string defining the technical unique key |
||
64 | * @since 5.0.0 |
||
65 | */ |
||
66 | public function getKey() { |
||
69 | |||
70 | /** |
||
71 | * In comparison to getKey() this function returns a human readable (maybe translated) name |
||
72 | * |
||
73 | * @return mixed |
||
74 | * @since 5.0.0 |
||
75 | */ |
||
76 | public function getDisplayName() { |
||
79 | |||
80 | /** |
||
81 | * @param string $pattern which should match within the $searchProperties |
||
82 | * @param array $searchProperties defines the properties within the query pattern should match |
||
83 | * @param array $options - for future use. One should always have options! |
||
84 | * @return array an array of contacts which are arrays of key-value-pairs |
||
85 | * @since 5.0.0 |
||
86 | */ |
||
87 | public function search($pattern, $searchProperties, $options) { |
||
97 | |||
98 | /** |
||
99 | * @param array $properties this array if key-value-pairs defines a contact |
||
100 | * @return array an array representing the contact just created or updated |
||
101 | * @since 5.0.0 |
||
102 | */ |
||
103 | public function createOrUpdate($properties) { |
||
130 | |||
131 | /** |
||
132 | * @return mixed |
||
133 | * @since 5.0.0 |
||
134 | */ |
||
135 | public function getPermissions() { |
||
155 | |||
156 | /** |
||
157 | * @param object $id the unique identifier to a contact |
||
158 | * @return bool successful or not |
||
159 | * @since 5.0.0 |
||
160 | */ |
||
161 | public function delete($id) { |
||
165 | |||
166 | /** |
||
167 | * read vCard data into a vCard object |
||
168 | * |
||
169 | * @param string $cardData |
||
170 | * @return VCard |
||
171 | */ |
||
172 | protected function readCard($cardData) { |
||
175 | |||
176 | /** |
||
177 | * create UID for contact |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | protected function createUid() { |
||
189 | |||
190 | /** |
||
191 | * getUid is only there for testing, use createUid instead |
||
192 | */ |
||
193 | protected function getUid() { |
||
196 | |||
197 | /** |
||
198 | * create empty vcard |
||
199 | * |
||
200 | * @param string $uid |
||
201 | * @return VCard |
||
202 | */ |
||
203 | protected function createEmptyVCard($uid) { |
||
208 | |||
209 | /** |
||
210 | * create array with all vCard properties |
||
211 | * |
||
212 | * @param VCard $vCard |
||
213 | * @return array |
||
214 | */ |
||
215 | protected function vCard2Array(VCard $vCard) { |
||
249 | |||
250 | /** |
||
251 | * Get the type of the current property |
||
252 | * |
||
253 | * @param Property $property |
||
254 | * @return null|string |
||
255 | */ |
||
256 | protected function getTypeFromProperty(Property $property) { |
||
267 | } |
||
268 |