* * @method JobProfile|null find($id, $lockMode = null, $lockVersion = null) * @method JobProfile|null findOneBy(array $criteria, array $orderBy = null) * @method JobProfile[] findAll() * @method JobProfile[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class JobProfileRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, JobProfile::class); } public function getList(): array { $qb = $this->createQueryBuilder('job_profile'); return $qb ->select('job_profile', 'required_training') ->leftJoin('job_profile.requiredTrainings', 'required_training') ->orderBy('job_profile.name', 'ASC') ->getQuery() ->getResult() ; } }