aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV
diff options
context:
space:
mode:
authorhamza221 <hamzamahjoubi221@gmail.com>2023-11-14 14:09:12 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2023-11-14 18:29:42 +0100
commit26ee5a531bad3516ea34e235b804ee223972a4e1 (patch)
tree670c02bb70dffddab015cca6dda62c5cb06d0b00 /apps/dav/lib/CardDAV
parent8b5d85a9539aa295a5c412d78f3981ee7c89577d (diff)
downloadnextcloud-server-26ee5a531bad3516ea34e235b804ee223972a4e1.tar.gz
nextcloud-server-26ee5a531bad3516ea34e235b804ee223972a4e1.zip
feat(search): allow contacts person search
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/lib/CardDAV')
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 613ec16921f..9a05abed049 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -1118,6 +1118,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* wildcard?: bool,
* since?: DateTimeFilter|null,
* until?: DateTimeFilter|null,
+ * person?: string
* } $options
* @return array
*/
@@ -1182,6 +1183,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$query2->setFirstResult($options['offset']);
}
+ if (isset($options['person'])) {
+ $query2->andWhere($query2->expr()->ilike('cp.value', $query2->createNamedParameter('%' . $this->db->escapeLikeParameter($options['person']) . '%')));
+ }
if (isset($options['since']) || isset($options['until'])) {
$query2->join('cp', $this->dbCardsPropertiesTable, 'cp_bday', 'cp.cardid = cp_bday.cardid');
$query2->andWhere($query2->expr()->eq('cp_bday.name', $query2->createNamedParameter('BDAY')));