/** * @param Country $country * * @return $this */ public function removeCountry($country) { $this->countryType->deleteById($country->getId()); }
/** * @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(); }
/** * @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(); }