/** * scan calendar for changed objects */ public function scan() { if (!$this->isCalendarsBackendValid()) { return; } $cachedList = $this->cache->listAll(); try { $remoteList = $this->objectAPI->listAll(); } catch (BackendUtils\Exception $ex) { return; } $list = array_merge($cachedList, $remoteList); foreach ($list as $l) { $this->scanObject($l); } }
/** * delete an object from a calendar * * @param \OCA\Calendar\IObject $object * @throws \OCA\Calendar\BusinessLayer\Exception */ public function delete(IObject $object) { try { $this->checkCalendarSupports(Permissions::DELETE); if (!$this->api instanceof BackendUtils\IObjectAPIDelete) { throw new Exception('Backend does not support deleting objects'); } Util::emitHook('\\OCA\\Calendar', 'preDeleteObject', array($object)); $this->api->delete($object); if ($this->isCachingEnabled) { $this->updater->propagate($object->getUri()); } Util::emitHook('\\OCA\\Calendar', 'postDeleteObject', array($object)); } catch (BackendUtils\Exception $ex) { throw Exception::fromException($ex); } }