feat(doctor-address): add city and province associations to DoctorAddress entity
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Clinic\Repository;
|
||||
|
||||
use App\Auth\Entity\User;
|
||||
use App\Clinic\Entity\Clinic;
|
||||
use App\Doctor\Entity\Doctor;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\Tools\Pagination\Paginator;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
@@ -20,6 +21,17 @@ class ClinicRepository extends ServiceEntityRepository
|
||||
return $this->findOneBy(['uuid' => $uuid]);
|
||||
}
|
||||
|
||||
/** @return Clinic[] */
|
||||
public function findByDoctor(Doctor $doctor): array
|
||||
{
|
||||
return $this->createQueryBuilder('c')
|
||||
->innerJoin('c.doctors', 'd')
|
||||
->where('d.id = :doctorId')
|
||||
->setParameter('doctorId', $doctor->getId())
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
public function findByUser(User $user): ?Clinic
|
||||
{
|
||||
return $this->findOneBy(['user' => $user]);
|
||||
|
||||
Reference in New Issue
Block a user