Skip to content
Snippets Groups Projects
Unverified Commit b1d4c3f5 authored by John Molakvoæ's avatar John Molakvoæ Committed by GitHub
Browse files

Merge pull request #13642 from nextcloud/contacts-menu-url-fix

Allow access to addressbook unique uri
parents 5f61fafa 22112bf7
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,15 @@ class AddressBookImpl implements IAddressBook { ...@@ -75,6 +75,15 @@ class AddressBookImpl implements IAddressBook {
return $this->addressBookInfo['id']; 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 * In comparison to getKey() this function returns a human readable (maybe translated) name
* *
......
...@@ -119,7 +119,12 @@ namespace OC { ...@@ -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 * @return array
* @since 6.0.0
* @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead
*/ */
public function getAddressBooks() { public function getAddressBooks() {
$this->loadAddressBooks(); $this->loadAddressBooks();
...@@ -131,6 +136,17 @@ namespace OC { ...@@ -131,6 +136,17 @@ namespace OC {
return $result; 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 * removes all registered address book instances
*/ */
......
...@@ -154,13 +154,25 @@ interface IManager { ...@@ -154,13 +154,25 @@ interface IManager {
public function register(\Closure $callable); public function register(\Closure $callable);
/** /**
* Return a list of the user's addressbooks display names
*
* @return array * @return array
* @since 6.0.0 * @since 6.0.0
* @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead
*/ */
public function getAddressBooks(); 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 * removes all registered address book instances
*
* @return void * @return void
* @since 6.0.0 * @since 6.0.0
*/ */
......
...@@ -45,6 +45,13 @@ namespace OCP { ...@@ -45,6 +45,13 @@ namespace OCP {
*/ */
public function getKey(); 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 * In comparison to getKey() this function returns a human readable (maybe translated) name
* @return mixed * @return mixed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment