1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 07:56:23 +00:00

Fix query builder in usage

This commit is contained in:
Loic Blot 2018-04-10 08:41:22 +02:00
parent 2b8e2ceb41
commit 0bac525826
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987

View File

@ -85,7 +85,9 @@ class SmsMapper extends Mapper {
->from('ocsms_smsdatas')
->where($qb->expr()->andX(
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
$qb->expr()->in('sms_mailbox', array(0, 1, 3))
$qb->expr()->in('sms_mailbox', array_map(function($mbid) use ($qb) {
return $qb->createNamedParameter($mbid);
}, array(0, 1, 3)))
)
);
@ -111,7 +113,9 @@ class SmsMapper extends Mapper {
->from('ocsms_smsdatas')
->where($qb->expr()->andX(
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
$qb->expr()->in('sms_mailbox', array(0, 1, 3))
$qb->expr()->in('sms_mailbox', array_map(function($mbid) use ($qb) {
return $qb->createNamedParameter($mbid);
}, array(0, 1, 3)))
)
);
$result = $qb->execute();