Esempio n. 1
0
 /**
  * @param ImportedHotel $source
  * @param Hotel $destination
  * @return mixed
  */
 public function map($source, $destination)
 {
     $destination->setName($source->getName());
     $destination->setCommercialName($source->getName());
     $destination->setRealName($source->getOfficialName() ?: $source->getName());
     $destination->setOfficialName($source->getOfficialName());
     $destination->setCodeAdherent($source->getCodeAdherent());
     $destination->setReservitId($source->getReservitId());
     $destination->setNameContact($source->getMainContact());
     $destination->setCurrency($source->getCurrency());
     $destination->setAdherent($source->getAdherent());
     $destination->setActiveFromArtsys($source->getStatus());
     $location = $source->getLocation();
     if ($location) {
         $destination->setAddress($location->getAddress1());
         $destination->setAdditionalAddress($location->getAddress2());
         $destination->setZipCode($location->getZipCode());
         $destination->setAddressContact($location->getAddress1());
         $destination->setCityContact($location->getCity());
         $destination->setLatitude($location->getLatitude());
         $destination->setLongitude($location->getLongitude());
     }
     $communication = $source->getCommunication();
     if ($communication) {
         $destination->setTelContact($communication->getPhone());
         $destination->setFaxContact($communication->getFax());
         $destination->setEmailContact($communication->getReceptionEmail());
         $destination->setWebsite($communication->getWebsite());
     }
     $features = $source->getFeatures();
     if ($features) {
         $destination->setStars($features->getStars());
         $destination->setYearlyClosing($features->getYearlyClosing());
         $destination->setWeeklyClosing($features->getWeeklyClosing());
         $destination->setAlwaysOpen($features->getAlwaysOpen());
         $destination->setReceptionSchedule($features->getReceptionTime());
         $destination->setNbRooms($features->getTotalRooms() ?: $features->getNbRooms());
         $destination->setNbSuites($features->getNbSuites());
         $destination->setNbFloors($features->getNbFloors());
         $destination->setCheckinTimeFromArtsys($features->getCheckInTime());
         $destination->setCheckoutTimeFromArtsys($features->getCheckOutTime());
         $destination->setBirds($features->getBirds());
     }
     $legal = $source->getLegal();
     if ($legal) {
         $destination->setVatNumber($legal->getVatNumber());
     }
     $other = $source->getOther();
     if ($other) {
         $destination->setLang($other->getLanguage());
         $destination->setSurroundingsDescription($other->getDescription());
         $destination->setForSale($other->getForSale() ?: false);
     }
     $info = $source->getInformation();
     if ($info) {
         $destination->setSehBox($info->getReservIt());
     }
     return $destination;
 }