55 return $this->addressBookInfo[
'uri'];
67 $obj = $this->carddavBackend->getCard($this->addressBookInfo[
'id'],
$name);
69 return new Card($this->carddavBackend, $this->addressBookInfo, $obj);
80 $objs = $this->carddavBackend->getCards($this->addressBookInfo[
'id']);
82 foreach ($objs as $obj) {
84 $children[] =
new Card($this->carddavBackend, $this->addressBookInfo, $obj);
101 $objs = $this->carddavBackend->getMultipleCards($this->addressBookInfo[
'id'],
$paths);
103 foreach ($objs as $obj) {
105 $children[] =
new Card($this->carddavBackend, $this->addressBookInfo, $obj);
138 if (is_resource($vcardData)) {
139 $vcardData = stream_get_contents($vcardData);
144 return $this->carddavBackend->createCard($this->addressBookInfo[
'id'],
$name, $vcardData);
155 $this->carddavBackend->deleteAddressBook($this->addressBookInfo[
'id']);
196 return $this->carddavBackend->updateAddressBook($this->addressBookInfo[
'id'], $propPatch);
214 foreach ($properties as $propertyName) {
216 if (isset($this->addressBookInfo[$propertyName])) {
218 $response[$propertyName] = $this->addressBookInfo[$propertyName];
237 return $this->addressBookInfo[
'principaluri'];
253 'privilege' =>
'{DAV:}all',
274 $this->carddavBackend instanceof Backend\SyncSupport &&
275 isset($this->addressBookInfo[
'{DAV:}sync-token'])
277 return $this->addressBookInfo[
'{DAV:}sync-token'];
280 $this->carddavBackend instanceof Backend\SyncSupport &&
281 isset($this->addressBookInfo[
'{http://sabredav.org/ns}sync-token'])
283 return $this->addressBookInfo[
'{http://sabredav.org/ns}sync-token'];
345 if (!$this->carddavBackend instanceof Backend\SyncSupport) {
349 return $this->carddavBackend->getChangesForAddressBook(
350 $this->addressBookInfo[
'id'],
An exception for terminatinating execution or to throw for unit testing.
The AddressBook class represents a CardDAV addressbook, owned by a specific user.
createDirectory($name)
Creates a new directory.
getChildren()
Returns the full list of cards.
getMultipleChildren(array $paths)
This method receives a list of paths in it's first argument.
setName($newName)
Renames the addressbook.
getOwner()
Returns the owner principal.
getSyncToken()
This method returns the current sync-token for this collection.
__construct(Backend\BackendInterface $carddavBackend, array $addressBookInfo)
Constructor.
propPatch(DAV\PropPatch $propPatch)
Updates properties on this node.
getChanges($syncToken, $syncLevel, $limit=null)
The getChanges method returns all the changes that have happened, since the specified syncToken and t...
getChildACL()
This method returns the ACL's for card nodes in this address book.
getLastModified()
Returns the last modification date as a unix timestamp.
createFile($name, $vcardData=null)
Creates a new file.
getName()
Returns the name of the addressbook.
getProperties($properties)
Returns a list of properties for this nodes.
getChild($name)
Returns a card.
The Card object represents a single Card from an addressbook.
This class represents a set of properties that are going to be updated.
static ensureUTF8($input)
This method takes an input string, checks if it's not valid UTF-8 and attempts to convert it to UTF-8...
If a class extends ISyncCollection, it supports WebDAV-sync.