Add back the name query part

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-04-21 20:40:13 +02:00
parent ecba3722da
commit 6d1651452f
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 3 additions and 1 deletions

View File

@ -872,9 +872,11 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$query2->selectDistinct('cp.cardid')->from($this->dbCardsPropertiesTable, 'cp');
$query2->andWhere($query2->expr()->eq('cp.addressbookid', $query->createNamedParameter($addressBookId)));
$or = $query2->expr()->orX();
foreach ($searchProperties as $property) {
$query2->expr()->orX($query2->expr()->eq('cp.name', $query->createNamedParameter($property)));
$or->add($query2->expr()->eq('cp.name', $query->createNamedParameter($property)));
}
$query2->andWhere($or);
$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
$query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c')