*/ final class EmployeeRttPaymentRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, EmployeeRttPayment::class); } public function findOneByEmployeeYearMonthRate(Employee $employee, int $year, int $month, string $rate): ?EmployeeRttPayment { return $this->findOneBy([ 'employee' => $employee, 'year' => $year, 'month' => $month, 'rate' => $rate, ]); } /** * @return EmployeeRttPayment[] */ public function findByEmployeeAndYear(Employee $employee, int $year): array { return $this->createQueryBuilder('p') ->andWhere('p.employee = :employee') ->andWhere('p.year = :year') ->setParameter('employee', $employee) ->setParameter('year', $year) ->addOrderBy('p.month', 'ASC') ->getQuery() ->getResult() ; } }