Moinax\TvDb\Client::getSerieByRemoteId PHP Method

getSerieByRemoteId() public method

Find a tv serie by a remote id
public getSerieByRemoteId ( array $remoteId, string $language = null ) : Serie
$remoteId array
$language string
return Serie
    public function getSerieByRemoteId(array $remoteId, $language = null)
    {
        $language = $language ?: $this->defaultLanguage;
        $data = $this->fetchXml('GetSeriesByRemoteID.php?' . http_build_query($remoteId) . '&language=' . $language);
        return new Serie($data->Series);
    }

Usage Example

Beispiel #1
0
 public function find($keys, $type = 'tv')
 {
     $this->validateKeys($keys);
     $key = 'tvdb' . $keys['imdb'];
     $result = $this->cache($key);
     if (!$result) {
         $result = $this->tvdb_api->getSerieByRemoteId(['imdbid' => $keys['imdb']]);
         $this->cache($key, $result);
     }
     if (!empty($result->id)) {
         return $this->tv($result->id);
     }
     return new Tv();
 }