diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-12-12 08:29:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-12 08:29:26 +0100 |
commit | d98dea1eb139ae33dfce28f5c61b140518ef4d1d (patch) | |
tree | 6bd1527425761a5b9c6657874e573f9a4ae8a38d /apps/dav/lib/CalDAV/CalDavBackend.php | |
parent | e1740c92421d9f6e05210c1cd69811e429f88410 (diff) | |
parent | 2b51d84b98a5a44c2a42a8498164a35b6822e760 (diff) | |
download | nextcloud-server-d98dea1eb139ae33dfce28f5c61b140518ef4d1d.tar.gz nextcloud-server-d98dea1eb139ae33dfce28f5c61b140518ef4d1d.zip |
Merge pull request #6884 from nextcloud/feature/3003/opt_out_of_birthday_calendar
Opt out of birthday calendar
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 8ecd64723a2..169bf6ff6a5 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -2285,6 +2285,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 |