/** * Creates a new address book * * @param string $principaluri * @param string $url Just the 'basename' of the url. * @param array $properties * @return void */ public function createAddressBook($principaluri, $url, array $properties) { $displayname = null; $description = null; foreach ($properties as $property => $newvalue) { switch ($property) { case '{DAV:}displayname': $name = $newvalue; break; case '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}addressbook-description': $description = $newvalue; break; default: throw new \Sabre\DAV\Exception\BadRequest('Unknown property: ' . $property); } } AddrBook::addFromDAVData($principaluri, $url, $name, $description); }