/**
  * Creates a new addressbook 
  * 
  * @param string $name
  * @param array $resourceType 
  * @param array $properties 
  * @return void
  */
 public function createExtendedCollection($name, array $resourceType, array $properties)
 {
     if (!in_array('{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook', $resourceType) || count($resourceType) !== 2) {
         throw new Sabre_DAV_Exception_InvalidResourceType('Unknown resourceType for this collection');
     }
     $this->carddavBackend->createAddressBook($this->principalUri, $name, $properties);
 }
Esempio n. 2
0
 /**
  * Returns the full list of cards
  *
  * @return array
  */
 public function getChildren()
 {
     $objs = $this->carddavBackend->getCards($this->addressBookInfo['id']);
     $children = array();
     foreach ($objs as $obj) {
         $children[] = new OC_Connector_Sabre_CardDAV_Card($this->carddavBackend, $this->addressBookInfo, $obj);
     }
     return $children;
 }
Esempio n. 3
0
 /**
  * Updates properties on this node,
  *
  * The properties array uses the propertyName in clark-notation as key,
  * and the array value for the property value. In the case a property
  * should be deleted, the property value will be null.
  *
  * This method must be atomic. If one property cannot be changed, the
  * entire operation must fail.
  *
  * If the operation was successful, true can be returned.
  * If the operation failed, false can be returned.
  *
  * Deletion of a non-existant property is always succesful.
  *
  * Lastly, it is optional to return detailed information about any
  * failures. In this case an array should be returned with the following
  * structure:
  *
  * array(
  *   403 => array(
  *      '{DAV:}displayname' => null,
  *   ),
  *   424 => array(
  *      '{DAV:}owner' => null,
  *   )
  * )
  *
  * In this example it was forbidden to update {DAV:}displayname. 
  * (403 Forbidden), which in turn also caused {DAV:}owner to fail
  * (424 Failed Dependency) because the request needs to be atomic.
  *
  * @param array $mutations 
  * @return bool|array 
  */
 public function updateProperties($mutations)
 {
     return $this->carddavBackend->updateAddressBook($this->addressBookInfo['id'], $mutations);
 }
Esempio n. 4
0
 /**
  * Deletes the card
  *
  * @return void
  */
 public function delete()
 {
     $this->carddavBackend->deleteCard($this->addressBookInfo['id'], $this->cardData['uri']);
 }
Esempio n. 5
0
 /**
  * Returns the last modification date as a unix timestamp.
  *
  * @return int|null
  */
 public function getLastModified()
 {
     return $this->carddavBackend->lastModifiedAddressBook($this->addressBookInfo['id']);
 }