aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2017-11-09 15:08:30 +0100
committerGeorg Ehrke <developer@georgehrke.com>2017-11-09 15:14:58 +0100
commit7784672cc00c83f1bfce57fc61eebe40c8f8c8a8 (patch)
treeeb5781ce2f1e34aa1f1f27f62472cb82b5cc7113 /apps
parentdd13aecc88b40bb2374a429ef4dd2dbc57e29a91 (diff)
downloadnextcloud-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.php10
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',