diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index 1aedd5d5643944bd4e3a3f58ad80472f428051ea..ae727b8544f98b97fe44d759261485d1b161f7f4 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -75,6 +75,15 @@ class AddressBookImpl implements IAddressBook { return $this->addressBookInfo['id']; } + /** + * @return string defining the unique uri + * @since 16.0.0 + * @return string + */ + public function getUri(): string { + return $this->addressBookInfo['uri']; + } + /** * In comparison to getKey() this function returns a human readable (maybe translated) name * diff --git a/lib/private/ContactsManager.php b/lib/private/ContactsManager.php index 6a83a718d419bec9c795114471e4a6a96383e265..e279997e634cfa6c241280d5f33d35ed746edd03 100644 --- a/lib/private/ContactsManager.php +++ b/lib/private/ContactsManager.php @@ -119,7 +119,12 @@ namespace OC { } /** + * Return a list of the user's addressbooks display names + * ! The addressBook displayName are not unique, please use getUserAddressBooks + * * @return array + * @since 6.0.0 + * @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead */ public function getAddressBooks() { $this->loadAddressBooks(); @@ -131,6 +136,17 @@ namespace OC { return $result; } + /** + * Return a list of the user's addressbooks + * + * @return IAddressBook[] + * @since 16.0.0 + */ + public function getUserAddressBooks(): Array { + $this->loadAddressBooks(); + return $this->addressBooks; + } + /** * removes all registered address book instances */ diff --git a/lib/public/Contacts/IManager.php b/lib/public/Contacts/IManager.php index ec399c37eb4097d6aa839a81a1f4c9d68a091d50..e744a92d9e29811c2b7d5435cb03919c0d97c992 100644 --- a/lib/public/Contacts/IManager.php +++ b/lib/public/Contacts/IManager.php @@ -154,13 +154,25 @@ interface IManager { public function register(\Closure $callable); /** + * Return a list of the user's addressbooks display names + * * @return array * @since 6.0.0 + * @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead */ public function getAddressBooks(); + /** + * Return a list of the user's addressbooks + * + * @return IAddressBook[] + * @since 16.0.0 + */ + public function getUserAddressBooks(); + /** * removes all registered address book instances + * * @return void * @since 6.0.0 */ diff --git a/lib/public/IAddressBook.php b/lib/public/IAddressBook.php index 4739e6f0c5bb2a16969a34975f8c77bbc83cfed7..c666311ffb22ff1fd47ddce8c0dc9b3447da2cdf 100644 --- a/lib/public/IAddressBook.php +++ b/lib/public/IAddressBook.php @@ -45,6 +45,13 @@ namespace OCP { */ public function getKey(); + /** + * @return string defining the unique uri + * @since 16.0.0 + * @return string + */ + public function getUri(): string; + /** * In comparison to getKey() this function returns a human readable (maybe translated) name * @return mixed