mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
controller + template made to list confirmed parcours for a specific user
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user