This commit is contained in:
2022-02-25 09:29:28 +01:00
parent c4e0b68ebe
commit 051ed19f97
11 changed files with 82 additions and 81 deletions

View File

@@ -11,7 +11,6 @@ declare(strict_types=1);
namespace Chill\BudgetBundle\Repository;
use Chill\PersonBundle\Entity\Household\Household;
use Chill\PersonBundle\Entity\Person;
use DateTime;
use Doctrine\ORM\EntityRepository;
@@ -24,7 +23,6 @@ use Doctrine\ORM\EntityRepository;
*/
class ResourceRepository extends EntityRepository
{
// public function findByEntity($entity)
// {
@@ -36,7 +34,7 @@ class ResourceRepository extends EntityRepository
$entityStr = $entity instanceof Person ? 'person' : 'household';
$qb->where("c.$entityStr = :$entityStr")
$qb->where("c.{$entityStr} = :{$entityStr}")
->andWhere('c.startDate < :date')
->andWhere('c.startDate < :date OR c.startDate IS NULL');
@@ -51,5 +49,4 @@ class ResourceRepository extends EntityRepository
return $qb->getQuery()->getResult();
}
}