updateAddressBook() public method

The list of mutations is stored in a Sabre\DAV\PropPatch object. To do the actual updates, you must tell this object which properties you're going to process with the handle() method. Calling the handle method is like telling the PropPatch object "I promise I can handle updating this property". Read the PropPatch documenation for more info and examples.
public updateAddressBook ( string $addressBookId, Sabre\DAV\PropPatch $propPatch ) : void
$addressBookId string
$propPatch Sabre\DAV\PropPatch
return void
Example #1
0
 public function testUpdateAddressBookSuccess()
 {
     $result = $this->backend->updateAddressBook(1, array('{DAV:}displayname' => 'updated', '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'updated'));
     $this->assertTrue($result);
     $result = $this->backend->getAddressBooksForUser('principals/user1');
     $expected = array(array('id' => 1, 'uri' => 'book1', 'principaluri' => 'principals/user1', '{DAV:}displayname' => 'updated', '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'updated', '{http://calendarserver.org/ns/}getctag' => 2, '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' => new CardDAV\Property\SupportedAddressData()));
     $this->assertEquals($expected, $result);
 }
Example #2
0
 function testUpdateAddressBookSuccess()
 {
     $propPatch = new PropPatch(['{DAV:}displayname' => 'updated', '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'updated']);
     $this->backend->updateAddressBook(1, $propPatch);
     $result = $propPatch->commit();
     $this->assertTrue($result);
     $result = $this->backend->getAddressBooksForUser('principals/user1');
     $expected = [['id' => 1, 'uri' => 'book1', 'principaluri' => 'principals/user1', '{DAV:}displayname' => 'updated', '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => 'updated', '{http://calendarserver.org/ns/}getctag' => 2, '{http://sabredav.org/ns}sync-token' => 2]];
     $this->assertEquals($expected, $result);
 }