PHP code example of numaxlab / cegal-client

1. Go to this page and download the library: Download numaxlab/cegal-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

numaxlab / cegal-client example snippets


use NumaxLab\Cegal\Client;

$client = Client::create('tu-usuario', 'tu-contraseña');

$availabilityCollection = $client->getAvailability('978-84-9865-535-7');
$availability = $availabilityCollection->first();

echo $availability->sinliId;
echo $availability->name;
echo $availability->isDistributor();
echo $availability->isBookshop();

// Para un único ISBN
$bookCollection = $client->getBookByIsbn('978-84-9865-535-7');
$book = $bookCollection->first();

echo $book->title;

// Para múltiples ISBNs
$bookCollection = $client->getBookByIsbn([
    '978-84-9865-535-7',
    '978-84-9182-325-4'
]);

foreach ($bookCollection as $book) {
    echo $book->title . "\n";
}