summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV/CalDavBackend.php
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2017-11-11 11:25:40 +0100
committerGeorg Ehrke <developer@georgehrke.com>2017-11-11 16:17:18 +0100
commit2b51d84b98a5a44c2a42a8498164a35b6822e760 (patch)
tree1a51737c0bdf59b74e1152d27f98fe5f1914263c /apps/dav/lib/CalDAV/CalDavBackend.php
parenta87d9860418948a72fbe3d29a2cc5d589be147ec (diff)
downloadnextcloud-server-2b51d84b98a5a44c2a42a8498164a35b6822e760.tar.gz
nextcloud-server-2b51d84b98a5a44c2a42a8498164a35b6822e760.zip
generate birthday calendars in a background job after admin enabled them
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/lib/CalDAV/CalDavBackend.php')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 9505a00ea55..73f0a287fae 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -2077,6 +2077,22 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
}
/**
+ * deletes all birthday calendars
+ */
+ public function deleteAllBirthdayCalendars() {
+ $query = $this->db->getQueryBuilder();
+ $result = $query->select(['id'])->from('calendars')
+ ->where($query->expr()->eq('uri',
+ $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI)))
+ ->execute();
+
+ $ids = $result->fetchAll();
+ foreach($ids as $id) {
+ $this->deleteCalendar($id['id']);
+ }
+ }
+
+ /**
* read VCalendar data into a VCalendar object
*
* @param string $objectData