Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #8 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
39 lines
971 B
PHP
39 lines
971 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Repository;
|
|
|
|
use App\Entity\Observation;
|
|
use DateTimeImmutable;
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
|
|
/**
|
|
* @extends ServiceEntityRepository<Observation>
|
|
*/
|
|
final class ObservationRepository extends ServiceEntityRepository
|
|
{
|
|
public function __construct(ManagerRegistry $registry)
|
|
{
|
|
parent::__construct($registry, Observation::class);
|
|
}
|
|
|
|
/**
|
|
* @return Observation[]
|
|
*/
|
|
public function findByMonth(DateTimeImmutable $from, DateTimeImmutable $to): array
|
|
{
|
|
return $this->createQueryBuilder('o')
|
|
->andWhere('o.month >= :from')
|
|
->andWhere('o.month <= :to')
|
|
->setParameter('from', $from)
|
|
->setParameter('to', $to)
|
|
->innerJoin('o.employee', 'e')
|
|
->addSelect('e')
|
|
->getQuery()
|
|
->getResult()
|
|
;
|
|
}
|
|
}
|