PHP 클래스 Moinax\TvDb\Client

저자: Jérôme Poskin ([email protected])
파일 보기 프로젝트 열기: moinax/tvdb 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$apiKey string API key for thetvdb.com
$baseUrl string Base url for TheTVDB
$defaultLanguage string Default language.
$httpClient Moinax\TvDb\Http\HttpClient HttpClient used to query the API.
$languages array Array of available languages
$mirrors array Array of available mirrors

공개 메소드들

메소드 설명
__construct ( string $baseUrl, string $apiKey )
fetchBanner ( string $banner ) : string Fetch banner raw jpeg data from banner mirror.
getActors ( integer $serieId ) : array Find all actors related to a serie
getBanners ( integer $serieId ) : string Find all banners related to a serie
getBannersFiltered ( $serieId, $filter ) Find banners that match a filter string Eg: poster or season
getDefaultLanguage ( ) : string Get the default query language.
getEpisode ( $serieId, $season, $episode, $language = null ) : Episode Get a specific episode by season and episode number
getEpisodeByAirDate ( $serieId, $airdate, null $language = null ) : Episode
getEpisodeById ( $episodeId, $language = null ) : Episode Get a specific episode by his id
getLanguage ( string $abbreviation ) : array Get a language information
getMirror ( integer $typeMask = self::MIRROR_TYPE_XML ) : string Get a random mirror from the list of available mirrors
getSerie ( $serieId, $language = null ) : Serie Find a tv serie by the id from thetvdb.com
getSerieByRemoteId ( array $remoteId, string $language = null ) : Serie Find a tv serie by a remote id
getSerieEpisodes ( integer $serieId, string $language = null, string $format = self::FORMAT_XML ) : array Get all episodes for a serie
getSeries ( string $seriesName, string $language = null ) : array Searches for tv serie based on series name
getServerTime ( ) : string Get the server time for further updates
getUpdates ( integer $previousTime ) : array Get updates list based on previous time you got data
removeEmptyIndexes ( array $array ) : array Removes indexes from an array if they are zero length after trimming
setDefaultLanguage ( string $language ) Set the default query language. It must be a valid language code.
setHttpClient ( Moinax\TvDb\Http\HttpClient $client ) Set the HttpClient used to query the API.

보호된 메소드들

메소드 설명
fetch ( string $url, array $params = [], string $method = self::GET ) : boolean | string Fetch data with curl
fetchXml ( string $function, array $params = [], string $method = self::GET ) : string Fetches data via curl and returns result
fetchZIP ( string $function, array $params = [], string $method = self::GET, string $file = null ) : string Fetches data via curl and returns result
getLanguages ( ) : SimpleXMLElement Get a list of languages available for the content of the api
getMirrors ( ) : void Get a list of mirrors available to fetchXml the data from the api
getXml ( string $data ) : SimpleXMLElement Convert xml string to SimpleXMLElement

메소드 상세

__construct() 공개 메소드

public __construct ( string $baseUrl, string $apiKey )
$baseUrl string Domain name of the api without trailing slash
$apiKey string Api key provided by http://thetvdb.com

fetch() 보호된 메소드

Fetch data with curl
protected fetch ( string $url, array $params = [], string $method = self::GET ) : boolean | string
$url string
$params array
$method string
리턴 boolean | string

fetchBanner() 공개 메소드

Fetch banner raw jpeg data from banner mirror.
public fetchBanner ( string $banner ) : string
$banner string the banner to fetch like graphical/79349-g7.jpg
리턴 string raw jpeg data

fetchXml() 보호된 메소드

Fetches data via curl and returns result
protected fetchXml ( string $function, array $params = [], string $method = self::GET ) : string
$function string The function used to fetch data in xml
$params array
$method string
리턴 string The data

fetchZIP() 보호된 메소드

Fetches data via curl and returns result
protected fetchZIP ( string $function, array $params = [], string $method = self::GET, string $file = null ) : string
$function string The function used to fetch data in zip
$params array
$method string
$file string The file to extract from the ZIP
리턴 string The data

getActors() 공개 메소드

Find all actors related to a serie
public getActors ( integer $serieId ) : array
$serieId integer
리턴 array

getBanners() 공개 메소드

Find all banners related to a serie
public getBanners ( integer $serieId ) : string
$serieId integer
리턴 string

getBannersFiltered() 공개 메소드

Find banners that match a filter string Eg: poster or season
public getBannersFiltered ( $serieId, $filter )

getDefaultLanguage() 공개 메소드

Get the default query language.
public getDefaultLanguage ( ) : string
리턴 string

getEpisode() 공개 메소드

Get a specific episode by season and episode number
public getEpisode ( $serieId, $season, $episode, $language = null ) : Episode
리턴 Episode

getEpisodeByAirDate() 공개 메소드

public getEpisodeByAirDate ( $serieId, $airdate, null $language = null ) : Episode
$serieId
$airdate
$language null
리턴 Episode

getEpisodeById() 공개 메소드

Get a specific episode by his id
public getEpisodeById ( $episodeId, $language = null ) : Episode
리턴 Episode

getLanguage() 공개 메소드

Get a language information
public getLanguage ( string $abbreviation ) : array
$abbreviation string
리턴 array

getLanguages() 보호된 메소드

Get a list of languages available for the content of the api
protected getLanguages ( ) : SimpleXMLElement
리턴 SimpleXMLElement

getMirror() 공개 메소드

Get a random mirror from the list of available mirrors
public getMirror ( integer $typeMask = self::MIRROR_TYPE_XML ) : string
$typeMask integer
리턴 string

getMirrors() 보호된 메소드

Get a list of mirrors available to fetchXml the data from the api
protected getMirrors ( ) : void
리턴 void

getSerie() 공개 메소드

Find a tv serie by the id from thetvdb.com
public getSerie ( $serieId, $language = null ) : Serie
리턴 Serie A serie object or false if not found

getSerieByRemoteId() 공개 메소드

Find a tv serie by a remote id
public getSerieByRemoteId ( array $remoteId, string $language = null ) : Serie
$remoteId array
$language string
리턴 Serie

getSerieEpisodes() 공개 메소드

Get all episodes for a serie
public getSerieEpisodes ( integer $serieId, string $language = null, string $format = self::FORMAT_XML ) : array
$serieId integer
$language string
$format string
리턴 array

getSeries() 공개 메소드

Searches for tv serie based on series name
public getSeries ( string $seriesName, string $language = null ) : array
$seriesName string
$language string
리턴 array

getServerTime() 공개 메소드

Get the server time for further updates
public getServerTime ( ) : string
리턴 string

getUpdates() 공개 메소드

Get updates list based on previous time you got data
public getUpdates ( integer $previousTime ) : array
$previousTime integer
리턴 array

getXml() 보호된 메소드

Convert xml string to SimpleXMLElement
protected getXml ( string $data ) : SimpleXMLElement
$data string
리턴 SimpleXMLElement

removeEmptyIndexes() 공개 정적인 메소드

Removes indexes from an array if they are zero length after trimming
public static removeEmptyIndexes ( array $array ) : array
$array array The array to remove empty indexes from
리턴 array An array with all empty indexes removed

setDefaultLanguage() 공개 메소드

Set the default query language. It must be a valid language code.
public setDefaultLanguage ( string $language )
$language string

setHttpClient() 공개 메소드

Set the HttpClient used to query the API.
public setHttpClient ( Moinax\TvDb\Http\HttpClient $client )
$client Moinax\TvDb\Http\HttpClient

프로퍼티 상세

$apiKey 보호되어 있는 프로퍼티

API key for thetvdb.com
protected string $apiKey
리턴 string

$baseUrl 보호되어 있는 프로퍼티

Base url for TheTVDB
protected string $baseUrl
리턴 string

$defaultLanguage 보호되어 있는 프로퍼티

Default language.
protected string $defaultLanguage
리턴 string

$httpClient 보호되어 있는 프로퍼티

HttpClient used to query the API.
protected HttpClient,Moinax\TvDb\Http $httpClient
리턴 Moinax\TvDb\Http\HttpClient

$languages 보호되어 있는 프로퍼티

Array of available languages
protected array $languages
리턴 array

$mirrors 보호되어 있는 프로퍼티

Array of available mirrors
protected array $mirrors
리턴 array