PHP Class seregazhuk\PinterestBot\Api\Response

Inheritance: implements seregazhuk\PinterestBot\Interfaces\ResponseInterface
显示文件 Open project: seregazhuk/php-pinterest-bot Class Usage Examples

Protected Properties

Property Type Description
$clientInfo array | null
$data mixed
$lastError array | null

Public Methods

Method 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

Protected Methods

Method 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 method

public fill ( $data )

getBookmarks() public method

Parse bookmarks from response.
public getBookmarks ( ) : array
return array

getClientInfo() public method

public getClientInfo ( ) : array | null
return array | null

getData() public method

public getData ( string $key = '', null $default = null ) : mixed
$key string
$default null
return mixed

getLastError() public method

public getLastError ( ) : array
return array

getPaginationData() public method

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

getResponseData() public method

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

getValueByKey() protected method

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

hasData() public method

public hasData ( string $key = '' ) : boolean
$key string
return boolean

hasErrors() public method

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

isEmpty() public method

Checks if response is empty.
public isEmpty ( ) : boolean
return boolean

isOk() public method

public isOk ( ) : boolean
return boolean

parseResponseData() protected method

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

Property Details

$clientInfo protected_oe property

protected array|null $clientInfo
return array | null

$data protected_oe property

protected mixed $data
return mixed

$lastError protected_oe property

protected array|null $lastError
return array | null