-
Notifications
You must be signed in to change notification settings - Fork 14
Availability Search
Salma Abdelhady edited this page Nov 30, 2017
·
6 revisions
The authority information, required by all Web Service operations, combines authentication and configuration:
`$auth = new RoomsXMLAuthentication();
$auth->setOrg(**); //Agency ID
$auth->setUserName(***); //Username
$auth->setPassword(***); //Password
$auth->setVersion('1.26');
$auth->setCurrency('USD');
$auth->setLanguage('en');//optional
$auth->setDebugMode(true);//optional
$auth->setTestMode(true);//optional
$availability = new AvailabilitySearch($auth);`
The HotelStayDetails XML structure is used in availability search and booking operations to describe the time period and room requirements for a booking
$hotelStayDetails = new HotelStayDetails();
$hotelStayDetails->setArrivalDate(new \DateTime("+2 weeks"));
$hotelStayDetails->setNationality('EG');
$hotelStayDetails->setNights(4);
$hotelStayDetails->setRoomsDetails(array(['adult' => 2, 'child' => 0]));
The hotel search criteria XML structure is a collection of optional elements to narrow down the set of hotels returned.
$hotelCriteria = new HotelSearchCriteria();
$hotelCriteria->setMinStars(3);
$hotelCriteria->setMaxPrice(1400);
$availability = new AvailabilitySearch($auth);
$availability->setRegionId(16294);//or $availability->setHotelId(*id*);
$availability->setHotelStayDetails($hotelStayDetails);
$availability->setHotelSearchCriteria($hotelCriteria);
/** @var AvailabilitySearchResult $availabilities */
$availabilities = $availability->checkAvailability();