This commit is contained in:
jleroy2023
2024-11-20 15:48:47 +01:00
parent e6954b6ce3
commit 0ff9ac68b2
4 changed files with 15 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ class AdminController extends AbstractController
$userConnect = $token?->getUser();
return $this->render('admin/user.html.twig', [
'profile' => $userConnect,
'participants' => $participantRepository->findAll(),
'participants' => $participantRepository->getAll(),
'controller_name' => 'AdminController',
]);
}

View File

@@ -4,6 +4,7 @@ namespace App\Repository;
use App\Entity\Participant;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\Tools\Pagination\Paginator;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
@@ -33,6 +34,16 @@ class ParticipantRepository extends ServiceEntityRepository
return $newProfile;
}
public function getAll(): Paginator
{
$qb = $this->createQueryBuilder('p')
->addSelect('s')
->leftJoin('p.site', 's')
->getQuery();
return new Paginator($qb);
}
// /**
// * @return Participant[] Returns an array of Participant objects
// */