PHP Класс LeagueWrap\Api\AbstractApi

Наследование: use trait LeagueWrap\Api\ConfigTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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