<?php

namespace RxConnexionBundle\Repository;

/**
 * BranchRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class BranchRepository extends \Doctrine\ORM\EntityRepository
{
    public function findByUserBranchIds($userData) {

        return $this->getEntityManager()->getRepository('RxConnexionBundle:BranchEntity')
            ->createQueryBuilder('b')
            ->where('b.id IN (:branchIds)')
            ->setParameter('branchIds', $userData['branchIds'])
            ->getQuery()
            ->getResult();
    }
}
