From 26ee5a531bad3516ea34e235b804ee223972a4e1 Mon Sep 17 00:00:00 2001 From: hamza221 Date: Tue, 14 Nov 2023 14:09:12 +0100 Subject: feat(search): allow contacts person search Signed-off-by: hamza221 Signed-off-by: Christoph Wurst --- apps/dav/lib/CardDAV/CardDavBackend.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/dav/lib/CardDAV') 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'))); -- cgit v1.2.3