/** * @param ImportedRegion $source * @param Region $destination * @return mixed */ public function map($source, $destination) { $destination->setReservitId($source->getReservitId()); $translations = array('fr' => $source->getFr(), 'en' => $source->getEn(), 'de' => $source->getDe(), 'es' => $source->getEs(), 'it' => $source->getIt(), 'nl' => $source->getNl()); $this->translateProperty($destination, 'name', $translations); return $destination; }
/** * @param Region $region * @param null $lang * @param bool $absolute * @return bool */ public function generateRegionUrl(Region $region, $lang = null, $absolute = false) { if ($lang === null) { $lang = $this->context->get('language'); } $slug = $region->getSlug(); if ($slug && $lang) { return $this->router->generate('destination_sheet_region', array('slugRegion' => $slug, 'locale' => $lang), $absolute); } return false; }
/** * @param Department $department * @param Region $region */ protected function removeDepartment($department, $region) { $regionId = $region->getId(); if (!isset($this->removeDepartments[$regionId])) { $this->removeDepartments[$regionId] = array(); } $this->removeDepartments[$regionId][] = $department->getId(); }
/** * @return Country */ public function getCountry() { return $this->region->getCountry(); }
/** * @param Region $region * * @return $this */ public function removeRegion($region) { $this->regionType->deleteById($region->getId()); }
/** * Removes a region. * * @param Region $region * @return $this For fluid purposes. */ public function removeRegion(\Seh\Bundle\SehBundle\Entity\Region $region) { $this->regions->removeElement($region); return $this; }
/** * @param Region $region * @return array */ public function findNbForRegionAndBrand($region, $brandId = null) { $regionId = $region; if ($region instanceof Region) { $regionId = $region->getId(); } $qb = $this->getValidQueryBuilder()->andWhere('r.id = :region')->setParameter(':region', $regionId)->select('COUNT(DISTINCT h.id) as nbHotels'); if ($brandId != null) { $qb->andWhere('b.id = :idBrand')->setParameter(':idBrand', $brandId); } return $qb->getQuery()->getSingleScalarResult(); }