digitalbrands / booking-com-sdk
v1.0.1-beta
2019-04-10 21:10 UTC
Requires
- php: ^7.1
- ext-json: *
- guzzlehttp/guzzle: ^6.3
- webmozart/assert: ^1.3
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-11-11 15:12:21 UTC
README
The library is in active development. Not ready for production yet.
This library is just simple wrapper around booking com API (https://developers.booking.com/api/).
Table of Contents
Installation
composer require digitalbrands/booking-com-sdk
Usage
Initialization
$client = Client::create([ 'login' => 'your_login', 'password' => 'your_password', 'timeout' => 5, // Optional 'v' => '2.2' // Optional ]);
blockAvailability
Not implemented yet
hotelAvailability
Not implemented yet
autocomplete
$models = $client->autocomplete(new AutocompleteQuery('test')); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
chainTypes
$models = $client->getChainTypes((new ChainTypesQuery()); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
changedHotels
$sinceDate=new \DateTime(); $model = $client->getChangedHotelsInfo(new ChangedHotelsQuery($sinceDate)); //Closed hotels $model->getClosedHotels(); //Changed hotels $model->getChangedHotels();
cities
$models = $client->getCities((new CitiesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
countries
$models = $client->getCountries((new CountriesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
districts
$models = $client->getDistricts((new DistrictsQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
facilityTypes
$models = $client->getFacilityTypes((new FacilityTypesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
hotelFacilityTypes
$models = $client->getHotelFacilityTypes((new HotelFacilityTypesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
hotels
$models = $client->getHotels((new HotelsQuery())); foreach ($models as $model){ print $model->getId(); print $model->getInfo(); // etc }
hotelThemeTypes
$models = $client->getHotelThemeTypes((new HotelThemeTypesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
hotelTypes
$models = $client->getHotelTypes((new HotelTypesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
paymentTypes
$models = $client->getPaymentTypes((new PaymentTypesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
regions
$models = $client->getRegions((new RegionsQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
roomFacilityTypes
$models = $client->getRoomFacilityTypes((new RoomFacilityTypesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
roomTypes
$models = $client->getRoomTypes((new RoomTypesQuery())); foreach ($models as $model){ print $model->getId(); print $model->getName(); // etc }
Support
Please open an issue for support.
Contributing
Feel free to send a pull request!