コード例 #1
0
ファイル: AutocompleteManager.php プロジェクト: blab2015/seh
 /**
  * @param Country $country
  *
  * @return $this
  */
 public function removeCountry($country)
 {
     $this->countryType->deleteById($country->getId());
 }
コード例 #2
0
ファイル: DoctrineListener.php プロジェクト: blab2015/seh
 /**
  * @param Region $region
  * @param Country $country
  */
 protected function removeRegion($region, $country)
 {
     $countryId = $country->getId();
     if (!isset($this->removeRegions[$countryId])) {
         $this->removeRegions[$countryId] = array();
     }
     $this->removeRegions[$countryId][] = $region->getId();
 }
コード例 #3
0
ファイル: HotelRepository.php プロジェクト: blab2015/seh
 /**
  * @param Country $country
  * @return array
  */
 public function findNbForCountryAndBrand($country, $brandId = null)
 {
     $countryId = $country;
     if ($country instanceof Country) {
         $countryId = $country->getId();
     }
     $qb = $this->getValidQueryBuilder()->andWhere('c.id = :country')->setParameter(':country', $countryId)->select('COUNT(DISTINCT h.id) as nbHotels');
     if ($brandId != null) {
         $qb->andWhere('b.id = :idBrand')->setParameter(':idBrand', $brandId);
     }
     return $qb->getQuery()->getSingleScalarResult();
 }