diff options
author | Georg Ehrke <developer@georgehrke.com> | 2017-11-11 11:25:40 +0100 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2017-11-11 16:17:18 +0100 |
commit | 2b51d84b98a5a44c2a42a8498164a35b6822e760 (patch) | |
tree | 1a51737c0bdf59b74e1152d27f98fe5f1914263c /apps/dav/lib/CalDAV/CalDavBackend.php | |
parent | a87d9860418948a72fbe3d29a2cc5d589be147ec (diff) | |
download | nextcloud-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.php | 16 |
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 |