summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/BackgroundJob
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2018-08-24 15:21:04 +0200
committerGeorg Ehrke <developer@georgehrke.com>2018-10-08 01:25:20 +0200
commit1c6f666bbfc46b9092312c81f82a5e0cbe59fc18 (patch)
treeecb9d6ae2662d28b167574d2533f7917c7c2e20e /apps/dav/lib/BackgroundJob
parent4c47ec005f31e10b55af1bec277c6c0d011e4c28 (diff)
downloadnextcloud-server-1c6f666bbfc46b9092312c81f82a5e0cbe59fc18.tar.gz
nextcloud-server-1c6f666bbfc46b9092312c81f82a5e0cbe59fc18.zip
adjust Calendar resource / room interfaces to use class implementation
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/lib/BackgroundJob')
-rw-r--r--apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php32
1 files changed, 24 insertions, 8 deletions
diff --git a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
index c5f8f6586e9..3a9e3def05d 100644
--- a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
+++ b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
@@ -113,8 +113,12 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
foreach($sortedResources['new'] as $backendId => $newResources) {
foreach ($newResources as $newResource) {
- $resource = $this->resourceManager->getBackend($backendId)
- ->getResource($newResource);
+ $backend = $this->resourceManager->getBackend($backendId);
+ if ($backend === null) {
+ continue;
+ }
+
+ $resource = $backend->getResource($newResource);
$this->addToCache($this->resourceDbTable, $resource);
}
}
@@ -126,8 +130,12 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
}
foreach($sortedResources['edited'] as $backendId => $editedResources) {
foreach ($editedResources as $editedResource) {
- $resource = $this->resourceManager->getBackend($backendId)
- ->getResource($editedResource);
+ $backend = $this->resourceManager->getBackend($backendId);
+ if ($backend === null) {
+ continue;
+ }
+
+ $resource = $backend->getResource($editedResource);
$this->updateCache($this->resourceDbTable, $resource);
}
}
@@ -157,8 +165,12 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
foreach($sortedRooms['new'] as $backendId => $newRooms) {
foreach ($newRooms as $newRoom) {
- $resource = $this->roomManager->getBackend($backendId)
- ->getRoom($newRoom);
+ $backend = $this->roomManager->getBackend($backendId);
+ if ($backend === null) {
+ continue;
+ }
+
+ $resource = $backend->getRoom($newRoom);
$this->addToCache($this->roomDbTable, $resource);
}
}
@@ -170,8 +182,12 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
}
foreach($sortedRooms['edited'] as $backendId => $editedRooms) {
foreach ($editedRooms as $editedRoom) {
- $resource = $this->roomManager->getBackend($backendId)
- ->getRoom($editedRoom);
+ $backend = $this->roomManager->getBackend($backendId);
+ if ($backend === null) {
+ continue;
+ }
+
+ $resource = $backend->getRoom($editedRoom);
$this->updateCache($this->roomDbTable, $resource);
}
}