示例#1
0
 /**
  * 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':
                 $displayname = $newvalue;
                 break;
             case '{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description':
                 $description = $newvalue;
                 break;
             default:
                 throw new Sabre_DAV_Exception_BadRequest('Unknown property: ' . $property);
         }
     }
     OC_Contacts_Addressbook::addFromDAVData($principaluri, $url, $name, $description);
 }