add option to filter CalendarAPI by componenttype

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2017-11-09 15:08:30 +01:00
parent dd13aecc88
commit 7784672cc0
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
1 changed files with 8 additions and 2 deletions

View File

@ -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',