controller + template made to list confirmed parcours for a specific user

This commit is contained in:
2022-03-17 12:28:00 +01:00
parent 387b7c2fbd
commit 97731b0a9b
6 changed files with 222 additions and 64 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Repository;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
@@ -92,4 +93,26 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC
return $qb->getQuery()->getResult();
}
/**
* @return array|AccompanyingPeriod[]
*/
public function findByUserConfirmed(?User $user, int $limit, int $offset): array
{
if (null === $user) {
return [];
}
$qb = $this->accompanyingPeriodRepository->createQueryBuilder('ap');
$qb->where($qb->expr()->eq('ap.user', ':user'))
->andWhere(
$qb->expr()->eq('ap.step', ':confirmed')
)
->setParameter('user', $user)
->setParameter('confirmed', AccompanyingPeriod::STEP_CONFIRMED);
return $qb->getQuery()->getResult();
}
}