mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
issue641: same for actions: take children, propose only associated and sort them by ordering
This commit is contained in:
@@ -67,4 +67,21 @@ final class SocialActionRepository implements ObjectRepository
|
||||
{
|
||||
return SocialAction::class;
|
||||
}
|
||||
|
||||
public function findActionsNotDesactivated(): array
|
||||
{
|
||||
return $this->buildQueryWithDesactivatedDateCriteria()->getQuery()->getResult();
|
||||
}
|
||||
|
||||
private function buildQueryWithDesactivatedDateCriteria(): QueryBuilder
|
||||
{
|
||||
$qb = $this->repository->createQueryBuilder('sa');
|
||||
|
||||
$qb ->where('sa.desactivationDate is null')
|
||||
->orWhere('sa.desactivationDate > :now')
|
||||
->orderBy('sa.ordering', 'ASC')
|
||||
->setParameter('now', new \DateTime('now'));
|
||||
|
||||
return $qb;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user