Skip to content

Airportia/booking-com-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Booking.com SDK

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!