public function getBody() { $xml = ''; $xml .= Helper::wrapTag('HotelSearchCode', $this->getHotelSearchCode()); $xml .= Helper::wrapTag('ArrivalDate', $this->getDateFrom()); return $xml; }
public function getBody() { $xml = ''; $xml .= Helper::wrapTag('GoBookingCode', $this->getBookingCode()); $xml .= Helper::wrapTag('GetEmergencyPhone', $this->getEmergencyPhone() ? 'true' : 'false'); return $xml; }
public function getBody() { $xml = ""; foreach ($this->getBookingCodes() as $code) { $xml .= Helper::wrapTag('GoBookingCode', $code); } return $xml; }
public function getBody() { $xml = ""; $xml .= $this->getDateFrom() ? Helper::wrapTag('ArrivalDateRangeFrom', $this->getDateFrom()) : ""; $xml .= $this->getDateUntil() ? Helper::wrapTag('ArrivalDateRangeTo', $this->getDateUntil()) : ""; $xml .= $this->getNights() ? Helper::wrapTag('Nights', $this->getNights()) : ""; $xml .= $this->getPassengerName() ? Helper::wrapTag('PaxName', $this->getPassengerName()) : ""; $xml .= $this->getCity() ? Helper::wrapTag('CityCode', $this->getCity()) : ""; $xml .= $this->getHotelName() ? Helper::wrapTag('HotelName', $this->getHotelName()) : ""; return $xml; }
protected function process() { $info = Helper::map(self::$MAP_INFO, $this->_xml); $info['descriptions'] = Helper::map(self::$MAP_DESCRIPTION, $this->_xml); $info['category'] = CategoryEnum::toFloat($info['category']); $info['images'] = []; foreach ($this->_xml->Pictures->Picture as $picture) { $info['images'][] = (string) $picture; } $this->_data = $info; }
protected function process() { $hotels = []; foreach ($this->_xml->Hotel as $node) { $hotel = Helper::map(self::$MAP_HOTEL, $node); //$hotel['category'] = CategoryEnum::toFloat($hotel['category']); $hotel['city_id'] = $this->getRequest()->getCity(); if (!array_key_exists($hotel['hotel_code'], $hotels)) { $hotels[$hotel['hotel_code']] = $hotel; $hotels[$hotel['hotel_code']]['rooms'] = []; } $room = Helper::map(self::$MAP_ROOM, $node); //$room['hotel_code'] = $hotel['hotel_code']; $room['date_cancel'] = Helper::fixCxlDate($room['date_cancel']); $hotels[$hotel['hotel_code']]['rooms'][] = $room; } $this->_data = $hotels; }
protected function process() { $transfers = []; $search_id = (string) $this->_xml->searchID; //ez a fejben van foreach ($this->_xml->TransferResult as $node) { $transfer = Helper::map(self::$MAP, $node); //fenti static alapján átnevezi /* //órát át kell váltani percé preg_match('/((?<hour>[\d\.\,]+)\shours?)?((?<minute>[\d\.\,]+)\smin(ute)?s?)?/',$transfer['minute'],$matches); $hour = floatval(str_replace(',','.',$matches['hour'])); $minute = floatval(str_replace(',','.',$matches['minute'])); $transfer['minute'] = $hour * 60 + $minute; */ $transfer['search_id'] = $search_id; $transfers[] = $transfer; } $this->_data = $transfers; }
public function getBody() { if ($this->_city < 1 && $this->_hotelCode < 1) { throw new Exception("CityCode or HotelId must be specified!"); } if ($this->_dateFrom < 1) { throw new Exception("ArrivalDate must be specified!"); } if ($this->_nights < 1) { throw new Exception("Nights must be specified!"); } if (count($this->_rooms) < 1) { throw new Exception("At least one room must be specified!"); } $xml = ""; $xml .= Helper::wrapTag("MaximumWaitTime", $this->getService()->getTimeout()); $xml .= Helper::wrapTag("MaxResponses", $this->getService()->getMaxResult()); if ($this->getCity() > 0) { $xml .= Helper::wrapTag("CityCode", $this->getCity()); } if ($this->getHotelCode() > 0) { $xml .= Helper::wrapTag('Hotels', Helper::wrapTag('HotelId', $this->getHotelCode())); } $xml .= Helper::wrapTag("ArrivalDate", $this->getDateFrom()); $xml .= Helper::wrapTag("Nights", intval($this->getNights())); $xml .= Helper::wrapTag('Apartments', $this->getApartments() ? 'true' : 'false'); if ($this->getSort()) { $xml .= Helper::wrapTag("SortOrder", intval($this->getSort())); } $rooms = ''; foreach ($this->getRooms() as $r) { $children = ''; for ($c = 0; $c < $r['children']; $c++) { $children .= Helper::wrapTag('ChildAge', Room::CHILD_AGE); } $rooms .= Helper::wrapTag('Room', $children, ['RoomCount' => 1, 'Adults' => $r['adults'], 'CotCount' => $r['infant']]); } $xml .= Helper::wrapTag('Rooms', $rooms); return $xml; }
protected function process() { $this->_data = Helper::map(self::$MAP_INFO, $this->_xml); $this->_data['alternative_hotel'] = !is_object($this->_xml->NoAlternativeHotel); $this->_data['leader_person'] = max(1, $this->_xml->Leader['LeaderPersonID']); }
public function getBody() { $xml = ""; if ($this->_PickUpType_IN) { //reptérről befelé $xml .= Helper::WrapTag('PickUpType', 'Airport'); $xml .= Helper::WrapTag('PickUpCode', $this->_AirportCode); $xml .= Helper::WrapTag('DropOffType', 'Accomodation'); if ($this->_HotelCode != "") { $xml .= Helper::WrapTag('DropOffCode', $this->_HotelCode, ['type' => "hotel"]); } else { $xml .= Helper::WrapTag('DropOffCode', $this->_CityCode, ['type' => "city"]); } } else { //reptérre kifelé $xml .= Helper::WrapTag('PickUpType', 'Accomodation'); if ($this->_HotelCode != "") { $xml .= Helper::WrapTag('PickUpCode', $this->_HotelCode, ['type' => "hotel"]); } else { $xml .= Helper::WrapTag('PickUpCode', $this->_CityCode, ['type' => "city"]); } $xml .= Helper::WrapTag('DropOffType', 'Airport'); $xml .= Helper::WrapTag('DropOffCode', $this->_AirportCode); } $xml .= Helper::WrapTag('ArrivalDate', $this->_date); $xml .= Helper::WrapTag('Passengers', $this->_PassengersNumber); $xml .= Helper::WrapTag('Currency', $this->_Currency); $xml .= Helper::WrapTag('Language', $this->_DriverLanguage); return $xml; }
public function xmlForBooking($roomId = 1, $personStartId = 1) { if (!$this->isValidForBooking()) { throw new Exception("The room must be set up with traveler names for booking"); } $pid = $personStartId; $xml = '<RoomType Adults="' . $this->countAdults() . '"'; if ($this->getInfant() > 0) { $xml .= ' CotCount="' . $this->getInfant() . '"'; } $xml .= '>'; $xml .= '<Room RoomID="' . $roomId . '">'; for ($a = 0; $a < $this->countAdults(); $a++) { $xml .= '<PersonName PersonID="' . $pid . '">' . strtoupper(Helper::stripAccent($this->getAdultName($a))) . '</PersonName>'; $pid++; } for ($c = 0; $c < $this->countChildren(); $c++) { $xml .= '<ExtraBed PersonID="' . $pid . '" ChildAge="' . $this->getChildAge($c) . '">' . strtoupper(Helper::stripAccent($this->getChildName($c))) . '</ExtraBed>'; $pid++; } $xml .= '</Room>'; $xml .= '</RoomType>'; return $xml; }
public function getBody() { return Helper::wrapTag('GoBookingCode', $this->getBookingCode()); }
public function getBody() { $xml = ""; $xml .= Helper::wrapTag('AgentReference', $this->getReference()); $xml .= Helper::wrapTag('HotelSearchCode', $this->getHotelSearchCode()); $xml .= Helper::wrapTag('ArrivalDate', $this->getDateFrom()); $xml .= Helper::wrapTag('Nights', $this->getNights()); $xml .= Helper::wrapTag('NoAlternativeHotel', $this->getAlternative() ? 'false' : 'true'); $xml .= Helper::wrapTag('Leader', false, ['LeaderPersonID' => $this->getLeader()]); $rooms = ''; $pid = 1; for ($r = 1; $r <= $this->countRooms(); $r++) { $room = $this->getRoom($r); $rooms .= $room->xmlForBooking($r, $pid); $pid += $room->countPersons(); } $xml .= Helper::wrapTag('Rooms', $rooms); return $xml; }
protected function process() { $transfer = Helper::map(self::$MAP, $this->_xml); //fenti static alapján átnevezi $this->_data = $transfer; }
public function getBody() { $xml = ""; $xml .= Helper::WrapTag('searchID', $this->_SearchID); $xml .= Helper::WrapTag('ItemCode', $this->_ItemCode); $xml .= Helper::WrapTag('VehicleID', $this->_VehicleID); $xml .= Helper::WrapTag('PickupTime', $this->_PickupTime); if ($this->_PickUpType_IN) { //reptérről befelé $xml .= Helper::WrapTag('ArrivingCityID', $this->_TargetCityID); $xml .= Helper::WrapTag('PickupFlightNumber', $this->_FlightNumber); $xml .= Helper::WrapTag('DropOffHotel', $this->_HotelName); $xml .= Helper::WrapTag('DropOffAddress', $this->_HotelAddress); } else { //szállásról a reptérre $xml .= Helper::WrapTag('DropOffTime', $this->_PickupTime); $xml .= Helper::WrapTag('PickupHotel', $this->_HotelName); $xml .= Helper::WrapTag('PickupAddress', $this->_HotelAddress); $xml .= Helper::WrapTag('DropOffFlightNumber', $this->_FlightNumber); $xml .= Helper::WrapTag('DepartingToCityID', $this->_TargetCityID); } $xml .= Helper::WrapTag('PassengersNum', $this->_PassengersNum); $xml .= Helper::WrapTag('PassengerName', $this->_PassengerName); $xml .= Helper::WrapTag('Remarks', $this->_Remarks); $xml .= Helper::WrapTag('AgencyReference', $this->_AgencyReference); return $xml; }
public function getBody() { return Helper::wrapTag('HotelSearchCode', $this->getHotelSearchCode()); }