mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
household list of accompanying periods + upgrade DBAL version to 3.1
This commit is contained in:
@@ -8,7 +8,7 @@ use Doctrine\ORM\QueryBuilder;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Chill\TaskBundle\Security\Authorization\TaskVoter;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
|
||||
/**
|
||||
@@ -120,13 +120,13 @@ class SingleTaskRepository extends EntityRepository
|
||||
throw new \UnexpectedValueException("params 'center' should be an instance of ".Center::class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (\array_key_exists('unassigned', $params) and $params['unassigned'] === true) {
|
||||
if (\array_key_exists('user', $params) and !empty($params['user'])) {
|
||||
throw new \UnexpectedValueException("You should not require for "
|
||||
. "unassigned tasks and tasks assigned to some user.");
|
||||
}
|
||||
|
||||
|
||||
$qb->andWhere($qb->expr()->isNull('st.assignee'));
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ class SingleTaskRepository extends EntityRepository
|
||||
$qb->andWhere($qb->expr()->eq('st.circle', ':scope'));
|
||||
$qb->setParameter('scope', $params['scope']);
|
||||
}
|
||||
|
||||
|
||||
if (\array_key_exists('types', $params) && $params['types'] !== NULL) {
|
||||
if (count($params['types']) > 0) {
|
||||
$qb->andWhere($qb->expr()->in('st.type', ':types'));
|
||||
@@ -154,7 +154,7 @@ class SingleTaskRepository extends EntityRepository
|
||||
if (\array_key_exists('is_closed', $params)) {
|
||||
$qb->andWhere($this->buildIsClosed($qb, !$params['is_closed']));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function addTypeFilter(QueryBuilder $qb, $params)
|
||||
@@ -191,7 +191,7 @@ class SingleTaskRepository extends EntityRepository
|
||||
->add($this->buildNowIsAfterStartDate($qb, true))
|
||||
;
|
||||
}
|
||||
$qb->setParameter('now', new \DateTime('today'), Type::DATE);
|
||||
$qb->setParameter('now', new \DateTime('today'), Types::DATE_MUTABLE);
|
||||
$qb->andWhere($andWhere);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user