PHP 클래스 LeagueWrap\Api\AbstractApi

상속: use trait LeagueWrap\Api\ConfigTrait
파일 보기 프로젝트 열기: paquettg/leaguewrap 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$api Provides access to the api object to perform requests on different api endpoints.
$cache LeagueWrap\CacheInterface This is the cache container that we intend to use.
$client LeagueWrap\ClientInterface The client used to communicate with the api.
$collection LeagueWrap\Limit\Collection The collection of limits to be used on this api.
$defaultRemember integer The amount of time we intend to remember the response for.
$key The key to be used by the api.
$permittedRegions A list of all permitted regions for this API call. Leave it empty to not lock out any region string.
$requests A count of the amount of API request this object has done so far.
$responseErrors List of http error response codes and associated erro message with each code.
$seconds integer The amount of seconds to keep things in cache
$version The version we want to use. If null use the first version in the array.

공개 메소드들

메소드 설명
__construct ( LeagueWrap\ClientInterface $client, LeagueWrap\Limit\Collection $collection, LeagueWrap\Api $api ) Default DI constructor.
getDomain ( ) : String
getRegion ( ) : Region
getRequestCount ( ) : integer Returns the amount of requests this object has done to the api so far.
remember ( integer $seconds = null, LeagueWrap\CacheInterface $cache = null ) Sets the amount of seconds we should remember the response for.
selectVersion ( string $version ) : boolean | $this Select the version of the api you wish to query.
setKey ( string $key ) Set the key to be used in the api.

보호된 메소드들

메소드 설명
attachResponse ( mixed $identity, mixed $response, string $key ) : boolean Attempts to attach the response to a summoner object.
attachResponses ( array | LeagueWrap\Dto\Summoner $identities, mixed $responses, string $key ) : boolean Attempts to attach all the responses to the correct summoner.
attachStaticDataToDto ( LeagueWrap\Dto\AbstractDto $dto ) : LeagueWrap\Dto\AbstractDto Will attempt to attach any static data to the given dto if the attach static data flag is set.
checkResponseErrors ( Response $response ) Checks the response for Http errors.
clientRequest ( boolean $static, string $uri, array $params ) : Response Make the actual request.
extractId ( LeagueWrap\Dto\Summoner | integer $identity ) : integer Attempts to extract an ID from the object/value given
extractIds ( mixed $identities ) : array Attempts to extract an ID from the array given.
getVersion ( ) : string Get the version string.
request ( string $path, array $params = [], boolean $static = false, boolean $isVersionized = true ) : mixed Wraps the request of the api in this method.

메소드 상세

__construct() 공개 메소드

Default DI constructor.
public __construct ( LeagueWrap\ClientInterface $client, LeagueWrap\Limit\Collection $collection, LeagueWrap\Api $api )
$client LeagueWrap\ClientInterface
$collection LeagueWrap\Limit\Collection
$api LeagueWrap\Api

attachResponse() 보호된 메소드

Attempts to attach the response to a summoner object.
protected attachResponse ( mixed $identity, mixed $response, string $key ) : boolean
$identity mixed
$response mixed
$key string
리턴 boolean

attachResponses() 보호된 메소드

Attempts to attach all the responses to the correct summoner.
protected attachResponses ( array | LeagueWrap\Dto\Summoner $identities, mixed $responses, string $key ) : boolean
$identities array | LeagueWrap\Dto\Summoner
$responses mixed
$key string
리턴 boolean

attachStaticDataToDto() 보호된 메소드

Will attempt to attach any static data to the given dto if the attach static data flag is set.
protected attachStaticDataToDto ( LeagueWrap\Dto\AbstractDto $dto ) : LeagueWrap\Dto\AbstractDto
$dto LeagueWrap\Dto\AbstractDto
리턴 LeagueWrap\Dto\AbstractDto

checkResponseErrors() 보호된 메소드

Checks the response for Http errors.
protected checkResponseErrors ( Response $response )
$response LeagueWrap\Response

clientRequest() 보호된 메소드

Make the actual request.
protected clientRequest ( boolean $static, string $uri, array $params ) : Response
$static boolean
$uri string
$params array
리턴 LeagueWrap\Response

extractId() 보호된 메소드

Attempts to extract an ID from the object/value given
protected extractId ( LeagueWrap\Dto\Summoner | integer $identity ) : integer
$identity LeagueWrap\Dto\Summoner | integer
리턴 integer

extractIds() 보호된 메소드

Attempts to extract an ID from the array given.
protected extractIds ( mixed $identities ) : array
$identities mixed
리턴 array

getDomain() 추상적인 공개 메소드

abstract public getDomain ( ) : String
리턴 String domain used for the request

getRegion() 공개 메소드

public getRegion ( ) : Region
리턴 LeagueWrap\Region region of this api

getRequestCount() 공개 메소드

Returns the amount of requests this object has done to the api so far.
public getRequestCount ( ) : integer
리턴 integer

getVersion() 보호된 메소드

Get the version string.
protected getVersion ( ) : string
리턴 string

remember() 공개 메소드

Leave it empty (or null) if you want to use the default set for each api request.
public remember ( integer $seconds = null, LeagueWrap\CacheInterface $cache = null )
$seconds integer
$cache LeagueWrap\CacheInterface

request() 보호된 메소드

Wraps the request of the api in this method.
protected request ( string $path, array $params = [], boolean $static = false, boolean $isVersionized = true ) : mixed
$path string
$params array
$static boolean
$isVersionized boolean
리턴 mixed

selectVersion() 공개 메소드

Select the version of the api you wish to query.
public selectVersion ( string $version ) : boolean | $this
$version string
리턴 boolean | $this

setKey() 공개 메소드

Set the key to be used in the api.
public setKey ( string $key )
$key string

프로퍼티 상세

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

Provides access to the api object to perform requests on different api endpoints.
protected $api

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

This is the cache container that we intend to use.
protected CacheInterface,LeagueWrap $cache
리턴 LeagueWrap\CacheInterface

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

The client used to communicate with the api.
protected ClientInterface,LeagueWrap $client
리턴 LeagueWrap\ClientInterface

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

The collection of limits to be used on this api.
protected Collection,LeagueWrap\Limit $collection
리턴 LeagueWrap\Limit\Collection

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

The amount of time we intend to remember the response for.
protected int $defaultRemember
리턴 integer

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

The key to be used by the api.
protected $key

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

A list of all permitted regions for this API call. Leave it empty to not lock out any region string.
protected $permittedRegions

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

A count of the amount of API request this object has done so far.
protected $requests

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

List of http error response codes and associated erro message with each code.
protected $responseErrors

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

The amount of seconds to keep things in cache
protected int $seconds
리턴 integer

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

The version we want to use. If null use the first version in the array.
protected $version