add progression

This commit is contained in:
BRAMAS Arthur
2025-10-24 16:14:44 +02:00
commit 1b0601d724
94 changed files with 12994 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Repository;
use App\Entity\Projet;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
class ProjetRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Projet::class);
}
/**
* Vérifie si un projet possède des contributions.
*/
public function hasContributions(Projet $projet): bool
{
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->select('count(c.id)')
->from('App\\Entity\\Contribution', 'c')
->where('c.projet = :projet')
->setParameter('projet', $projet);
return $qb->getQuery()->getSingleScalarResult() > 0;
}
}