PHP Class seregazhuk\PinterestBot\Api\Response

Inheritance: implements seregazhuk\PinterestBot\Interfaces\ResponseInterface
Afficher le fichier Open project: seregazhuk/php-pinterest-bot Class Usage Examples

Protected Properties

Свойство Type Description
$clientInfo array | null
$data mixed
$lastError array | null

Méthodes publiques

Méthode Description
fill ( $data )
getBookmarks ( ) : array Parse bookmarks from response.
getClientInfo ( ) : array | null
getData ( string $key = '', null $default = null ) : mixed
getLastError ( ) : array
getPaginationData ( ) : array Checks Pinterest API paginated response, and parses data with bookmarks info from it.
getResponseData ( null $key = null ) : array | boolean Check if specified data exists in response.
hasData ( string $key = '' ) : boolean
hasErrors ( ) : boolean Check for error info in api response and save it.
isEmpty ( ) : boolean Checks if response is empty.
isOk ( ) : boolean

Méthodes protégées

Méthode Description
getValueByKey ( string $key = '', array $data, mixed $default = null ) : array | boolean | mixed
parseResponseData ( string $key ) : boolean | array Parse data from Pinterest Api response.

Method Details

fill() public méthode

public fill ( $data )

getBookmarks() public méthode

Parse bookmarks from response.
public getBookmarks ( ) : array
Résultat array

getClientInfo() public méthode

public getClientInfo ( ) : array | null
Résultat array | null

getData() public méthode

public getData ( string $key = '', null $default = null ) : mixed
$key string
$default null
Résultat mixed

getLastError() public méthode

public getLastError ( ) : array
Résultat array

getPaginationData() public méthode

Checks Pinterest API paginated response, and parses data with bookmarks info from it.
public getPaginationData ( ) : array
Résultat array

getResponseData() public méthode

Check if specified data exists in response.
public getResponseData ( null $key = null ) : array | boolean
$key null
Résultat array | boolean

getValueByKey() protected méthode

protected getValueByKey ( string $key = '', array $data, mixed $default = null ) : array | boolean | mixed
$key string
$data array
$default mixed
Résultat array | boolean | mixed

hasData() public méthode

public hasData ( string $key = '' ) : boolean
$key string
Résultat boolean

hasErrors() public méthode

Check for error info in api response and save it.
public hasErrors ( ) : boolean
Résultat boolean

isEmpty() public méthode

Checks if response is empty.
public isEmpty ( ) : boolean
Résultat boolean

isOk() public méthode

public isOk ( ) : boolean
Résultat boolean

parseResponseData() protected méthode

Data is stored in ['resource_response']['data'] array.
protected parseResponseData ( string $key ) : boolean | array
$key string
Résultat boolean | array

Property Details

$clientInfo protected_oe property

protected array|null $clientInfo
Résultat array | null

$data protected_oe property

protected mixed $data
Résultat mixed

$lastError protected_oe property

protected array|null $lastError
Résultat array | null