src/Domain/Repository/TeamRepository.php line 19

Open in your IDE?
  1. <?php
  2. declare(strict_types 1);
  3. namespace App\Domain\Repository;
  4. use App\Domain\Entity\Team;
  5. use App\Domain\Repository\Interfaces\TeamRepositoryInterface;
  6. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  7. use Doctrine\Persistence\ManagerRegistry;
  8. class TeamRepository extends ServiceEntityRepository implements TeamRepositoryInterface
  9. {
  10.     public function __construct(ManagerRegistry $registry)
  11.     {
  12.         parent::__construct($registryTeam::class);
  13.     }
  14.     public function findTeams()
  15.     {
  16.         return $this->createQueryBuilder('t')
  17.             ->select('t.name memberName, t.tel memberPhone, t.email memberEmail, t.fonction, t.content memberContent, p.path, tc.content categoryContent, tc.name categoryName')
  18.             ->leftJoin('t.teamCategory''tc')
  19.             ->leftJoin('t.picture''p')
  20.             ->where('t.active = true')
  21.             ->orderBy('categoryName')
  22.             ->getQuery()
  23.             ->getResult();
  24.     }
  25. }