Exemplo n.º 1
0
 /**
  * Creates a new calendar
  *
  * @param string $name
  * @param array $resourceType
  * @param array $properties
  * @return void
  */
 public function createExtendedCollection($name, array $resourceType, array $properties)
 {
     if (!in_array('{urn:ietf:params:xml:ns:caldav}calendar', $resourceType) || count($resourceType) !== 2) {
         throw new Sabre_DAV_Exception_InvalidResourceType('Unknown resourceType for this collection');
     }
     $this->caldavBackend->createCalendar($this->principalInfo['uri'], $name, $properties);
 }
Exemplo n.º 2
0
 /**
  * Creates a new calendar
  *
  * @param string $name
  * @param array $resourceType
  * @param array $properties
  * @return void
  */
 public function createExtendedCollection($name, array $resourceType, array $properties)
 {
     $isCalendar = false;
     foreach ($resourceType as $rt) {
         switch ($rt) {
             case '{DAV:}collection':
             case '{http://calendarserver.org/ns/}shared-owner':
                 // ignore
                 break;
             case '{urn:ietf:params:xml:ns:caldav}calendar':
                 $isCalendar = true;
                 break;
             default:
                 throw new Sabre_DAV_Exception_InvalidResourceType('Unknown resourceType: ' . $rt);
         }
     }
     if (!$isCalendar) {
         throw new Sabre_DAV_Exception_InvalidResourceType('You can only create calendars in this collection');
     }
     $this->caldavBackend->createCalendar($this->principalInfo['uri'], $name, $properties);
 }