summaryrefslogtreecommitdiff
path: root/lib/Kolab/CardDAV/UserAddressBooks.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-06-20 08:06:43 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-06-20 08:06:43 (GMT)
commita7b85e71e8e06ddefaed655c602ac34b36d2e7f5 (patch)
tree341b3a08ee46f9c95fad98ceb8a51bdfb7611f7c /lib/Kolab/CardDAV/UserAddressBooks.php
parent103dd18e627de21a4ecebbd2eded10ac16e71d27 (diff)
downloadiRony-a7b85e71e8e06ddefaed655c602ac34b36d2e7f5.tar.gz
Improve CardDAV backend:
- Introduce aliases to make address books accessible via their folder name - make it play nice with the Mac OS Address Book which cannot handle multiple address books see https://code.google.com/p/sabredav/wiki/OSXAddressbook
Diffstat (limited to 'lib/Kolab/CardDAV/UserAddressBooks.php')
-rw-r--r--lib/Kolab/CardDAV/UserAddressBooks.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Kolab/CardDAV/UserAddressBooks.php b/lib/Kolab/CardDAV/UserAddressBooks.php
index 60be0f0..02707f0 100644
--- a/lib/Kolab/CardDAV/UserAddressBooks.php
+++ b/lib/Kolab/CardDAV/UserAddressBooks.php
@@ -48,4 +48,20 @@ class UserAddressBooks extends \Sabre\CardDAV\UserAddressBooks implements DAV\IE
return $objs;
}
+ /**
+ * Returns a single addressbook, by name
+ *
+ * @param string $name
+ * @return \AddressBook
+ */
+ public function getChild($name)
+ {
+ if ($addressbook = $this->carddavBackend->getAddressBookByName($name)) {
+ $addressbook['principaluri'] = $this->principalUri;
+ return new AddressBook($this->carddavBackend, $addressbook);
+ }
+
+ throw new DAV\Exception\NotFound('Addressbook with name \'' . $name . '\' could not be found');
+ }
+
}