<?php

namespace AppBundle\Entity\Person\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * Description of BankAccountRepository
 *
 */
class PersonRepository extends EntityRepository
{
    public function findAllByMail($mail)
    {
        $queryBuilder = $this->createQueryBuilder('o');
        $queryBuilder
            ->innerJoin('o.contactPoint', 'contactPoint')
            ->andWhere('contactPoint.email = :email')
            ->setParameter('email', $mail);

        return $queryBuilder->getQuery()->getResult();
    }
}

