owncloud/core — pull request #8136 by bartv2 (2014-04-09 19:58:27+00:00)
Title: Implement the register function of OC\ContactsManager

Tested this with the following code. The $key parameter is not really used in this implementation, because the keys for the address books are not predictable. Can we modify the interface and drop the key parameter?

```
$cm = \OC::$server->getContactsManager();
$cm->register('contacts', function() use ($api) {
if (\OCP\User::isLoggedIn()) {
$app = new App($api->getUserId());
$addressBooks = $app->getAddressBooksForUser();
foreach ($addressBooks as $addressBook) {
if ($addressBook->isActive()) {
\OCP\Contacts::registerAddressBook(new AddressbookProvider($addressBook));
}
}
}
});
```

@tanghus @DeepDiver1975