/** * function setCalendar() * * Sets the actual calendar to work with * * Debugging: * @throws CalDAVException * For debugging purposes, just sorround everything with try { ... } catch (Exception $e) { echo $e->__toString(); exit(-1); } */ function setCalendar(CalDAVCalendar $calendar) { if (!isset($this->client)) { throw new Exception('No connection. Try connect().'); } $this->client->SetCalendar($this->client->first_url_part . $calendar->getURL()); // Is there a '/' at the end of the calendar_url? if (!preg_match('#^.*?/$#', $this->client->calendar_url, $matches)) { $this->url = $this->client->calendar_url . '/'; } else { $this->url = $this->client->calendar_url; } }