diff options
author | Georg Ehrke <developer@georgehrke.com> | 2017-11-09 15:08:30 +0100 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2017-11-09 15:14:58 +0100 |
commit | 7784672cc00c83f1bfce57fc61eebe40c8f8c8a8 (patch) | |
tree | eb5781ce2f1e34aa1f1f27f62472cb82b5cc7113 /apps | |
parent | dd13aecc88b40bb2374a429ef4dd2dbc57e29a91 (diff) | |
download | nextcloud-server-7784672cc00c83f1bfce57fc61eebe40c8f8c8a8.tar.gz nextcloud-server-7784672cc00c83f1bfce57fc61eebe40c8f8c8a8.zip |
add option to filter CalendarAPI by componenttype
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/CalDAV/CalDavBackend.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index ee40963dee8..9045a62cde4 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -1383,8 +1383,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } $innerQuery->andWhere($or); - // TODO - add component-type - if ($pattern !== '') { $innerQuery->andWhere($innerQuery->expr()->iLike('op.value', $outerQuery->createNamedParameter('%' . @@ -1404,7 +1402,15 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $outerQuery->andWhere($outerQuery->expr()->lt('firstoccurence', $outerQuery->createNamedParameter($options['timerange']['end']->getTimeStamp))); } + } + if (isset($options['types'])) { + $or = $outerQuery->expr()->orX(); + foreach($options['types'] as $type) { + $or->add($outerQuery->expr()->eq('componenttype', + $outerQuery->createNamedParameter($type))); + } + $outerQuery->andWhere($or); } $outerQuery->andWhere($outerQuery->expr()->in('c.id', |