diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Db/CollectedAddressMapper.php | 14 | ||||
-rw-r--r-- | lib/Db/LocalAttachmentMapper.php | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/Db/CollectedAddressMapper.php b/lib/Db/CollectedAddressMapper.php index f7875e4a0..f7e396c76 100644 --- a/lib/Db/CollectedAddressMapper.php +++ b/lib/Db/CollectedAddressMapper.php @@ -48,13 +48,11 @@ class CollectedAddressMapper extends QBMapper { $dbQuery = $qb ->select('*') ->from($this->getTableName()) - ->where( - $qb->expr()->eq('user_id', $qb->createNamedParameter($userId)), - $qb->expr()->orX( - $qb->expr()->iLike('email', $qb->createNamedParameter("%$query%")), - $qb->expr()->iLike('display_name', $qb->createNamedParameter("%$query%")) - ) - ); + ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))) + ->andWhere($qb->expr()->orX( + $qb->expr()->iLike('email', $qb->createNamedParameter("%$query%")), + $qb->expr()->iLike('display_name', $qb->createNamedParameter("%$query%")) + )); return $this->findEntities($dbQuery); } @@ -65,7 +63,7 @@ class CollectedAddressMapper extends QBMapper { ->select('*') ->from($this->getTableName()) ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))) - ->andWhere($qb->expr()->eq('email', $qb->createNamedParameter($email))); + ->andWhere($qb->expr()->iLike('email', $qb->createNamedParameter($email))); return count($this->findEntities($dbQuery)) > 0; } diff --git a/lib/Db/LocalAttachmentMapper.php b/lib/Db/LocalAttachmentMapper.php index bd98e14bf..2c6a182fb 100644 --- a/lib/Db/LocalAttachmentMapper.php +++ b/lib/Db/LocalAttachmentMapper.php @@ -48,7 +48,8 @@ class LocalAttachmentMapper extends QBMapper { $query = $qb ->select('*') ->from($this->getTableName()) - ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); + ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))) + ->andWhere($qb->expr()->eq('id', $qb->createNamedParameter($id))); return $this->findEntity($query); } |