<?php
declare(strict_types = 1);
namespace App\Domain\Repository;
use App\Domain\Entity\Team;
use App\Domain\Repository\Interfaces\TeamRepositoryInterface;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
class TeamRepository extends ServiceEntityRepository implements TeamRepositoryInterface
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Team::class);
}
public function findTeams()
{
return $this->createQueryBuilder('t')
->select('t.name memberName, t.tel memberPhone, t.email memberEmail, t.fonction, t.content memberContent, p.path, tc.content categoryContent, tc.name categoryName')
->leftJoin('t.teamCategory', 'tc')
->leftJoin('t.picture', 'p')
->where('t.active = true')
->orderBy('categoryName')
->getQuery()
->getResult();
}
}