mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Handle case when some arguments are null in SingleTaskAclAwareRepository
This commit is contained in:
parent
8f39d0320c
commit
b05e128b5e
@ -58,12 +58,12 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository
|
|||||||
$qb
|
$qb
|
||||||
->from(SingleTask::class, 't');
|
->from(SingleTask::class, 't');
|
||||||
|
|
||||||
if (!empty($pattern)) {
|
if (null !== $pattern && '' !== $pattern) {
|
||||||
$qb->andWhere($qb->expr()->like('LOWER(UNACCENT(t.title))', 'LOWER(UNACCENT(:pattern))'))
|
$qb->andWhere($qb->expr()->like('LOWER(UNACCENT(t.title))', 'LOWER(UNACCENT(:pattern))'))
|
||||||
->setParameter('pattern', '%' . $pattern . '%');
|
->setParameter('pattern', '%' . $pattern . '%');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($users) > 0) {
|
if (null !== $users && count($users) > 0) {
|
||||||
$orXUser = $qb->expr()->orX();
|
$orXUser = $qb->expr()->orX();
|
||||||
|
|
||||||
foreach ($users as $key => $user) {
|
foreach ($users as $key => $user) {
|
||||||
@ -81,7 +81,7 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($flags) > 0) {
|
if (null !== $flags && count($flags) > 0) {
|
||||||
$orXDate = $qb->expr()->orX();
|
$orXDate = $qb->expr()->orX();
|
||||||
$orXState = $qb->expr()->orX();
|
$orXState = $qb->expr()->orX();
|
||||||
$now = new DateTime();
|
$now = new DateTime();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user