summaryrefslogtreecommitdiff
path: root/lib/Kolab/CardDAV/UserAddressBooks.php
diff options
context:
space:
mode:
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');
+ }
+
}