PHP code example of adrenth / thetvdb2

1. Go to this page and download the library: Download adrenth/thetvdb2 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/ */

    

adrenth / thetvdb2 example snippets


$client = new \Adrenth\Thetvdb\Client();
$client->setLanguage('nl');

// Obtain a token
$token = $client->authentication()->login($apiKey, $username, $userKey);
$client->setToken($token);

// Or refresh the token
$client->refreshToken();

$client->authentication()->login($apiKey, $username, $userKey);
$client->authentication()->refreshToken();

$client->languages()->all();
$client->languages()->get($languageId);

$client->episodes()->get($episodeId);

$client->series()->get($seriesId);
$client->series()->getActors($seriesId);
$client->series()->getEpisodes($seriesId);
$client->series()->getImages($seriesId);
$client->series()->getLastModified($seriesId);

$client->search()->seriesByName('lost');
$client->search()->seriesByImdbId('tt2243973');
$client->search()->seriesByZap2itId('EP015679352');

$client->updates()->query($fromTime, $toTime);

$client->users()->get();
$client->users()->getFavorites();
$client->users()->addFavorite($identifier);
$client->users()->removeFavorite($identifier);
$client->users()->getRatings();
$client->users()->addRating($type, $itemId, $rating);
$client->users()->updateRating($type, $itemId, $rating);
$client->users()->removeRating($type, $itemId);

$client->movies()->get(78398);
$client->movies()->getUpdates();

// Get all available languages
$languageData = $client->languages()->all(); // Returns a LanguageData instance
$languages = $languageData->getData()->all();

array:23 [▼
  0 => Language {#26 ▼
    -values: array:4 [▼
      "id" => 27
      "abbreviation" => "zh"
      "name" => "中文"
      "englishName" => "Chinese"
    ]
  }
  1 => Language {#19 ▶}
  2 => Language {#30 ▶}
  3 => Language {#21 ▶}
  // ..
];