예제 #1
0
 /**
  * @param Brand $brand
  * @return array
  */
 public function findAllWithHotelsForBrand($brand = null)
 {
     $queryBuilder = $this->createQueryBuilder('r')->select('r')->distinct()->join('r.hotels', 'h');
     if ($brand && $brand->getArtsysID() != 'SEH') {
         $queryBuilder->andWhere('h.brand = :brand')->setParameter(':brand', $brand);
     }
     return $queryBuilder->andWhere('h.active = :active')->andWhere('h.adherent = :adherent')->setParameter(':active', true)->setParameter(':adherent', true)->getQuery()->getResult();
 }