Findall does not support this behavior, in order to make the request on the fly (better in a separate repository class), you can do the following:
$qb = $em->getRepository("GerlaFrontendBundle:Store")->createQueryBuilder("p");
$province = $qb->select("p")
->distinct(true)
->getQuery()
->getResult();
Hope for this help
source
share