/**
  * Get number of objects in a calendar
  *
  * @throws \OCA\Calendar\BusinessLayer\Exception
  * @return array
  */
 public function listAll()
 {
     if ($this->isCachingEnabled) {
         if ($this->calendar->checkUpdate()) {
             $this->calendar->propagate();
         }
         return $this->cache->listAll();
     } else {
         return $this->api->listAll();
     }
 }
 /**
  * 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);
     }
 }