Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

API_ADD

API_ADD = 'https://api.weixin.qq.com/shakearound/page/add'

API_UPDATE

API_UPDATE = 'https://api.weixin.qq.com/shakearound/page/update'

API_DELETE

API_DELETE = 'https://api.weixin.qq.com/shakearound/page/delete'

Properties

$maxRetries

$maxRetries : integer

Type

integer

Methods

setHttp()

setHttp(\EasyWeChat\Core\Http  $http) : $this

Set the http instance.

Parameters

\EasyWeChat\Core\Http $http

Returns

$this

setAccessToken()

setAccessToken(\EasyWeChat\Core\AccessToken  $accessToken) : $this

Set the request token.

Parameters

\EasyWeChat\Core\AccessToken $accessToken

Returns

$this

maxRetries()

maxRetries(integer  $retries) 

Parameters

integer $retries

parseJSON()

parseJSON(string  $method, array  $args) : \EasyWeChat\Support\Collection

Parse JSON from response and check error.

Parameters

string $method
array $args

Throws

\EasyWeChat\Core\Exceptions\HttpException

Returns

\EasyWeChat\Support\Collection

| null

add()

add(string  $title, string  $description, string  $pageUrl, string  $iconUrl, string  $comment = '') : \EasyWeChat\Support\Collection

Add a page.

Parameters

string $title
string $description
string $pageUrl
string $iconUrl
string $comment

Returns

\EasyWeChat\Support\Collection

update()

update(integer  $pageId, string  $title, string  $description, string  $pageUrl, string  $iconUrl, string  $comment = '') : \EasyWeChat\Support\Collection

update a page info.

Parameters

integer $pageId
string $title
string $description
string $pageUrl
string $iconUrl
string $comment

Returns

\EasyWeChat\Support\Collection

fetchByIds()

fetchByIds(array  $pageIds) : \EasyWeChat\Support\Collection

Fetch batch of pages by pageIds.

Parameters

array $pageIds

Returns

\EasyWeChat\Support\Collection

pagination()

pagination(integer  $begin, integer  $count) : \EasyWeChat\Support\Collection

Pagination to fetch batch of pages.

Parameters

integer $begin
integer $count

Returns

\EasyWeChat\Support\Collection

registerHttpMiddlewares()

registerHttpMiddlewares() 

Register Guzzle middlewares.

accessTokenMiddleware()

accessTokenMiddleware() : \Closure

Attache access token to request query.

Returns

\Closure

logMiddleware()

logMiddleware() : \Closure

Log the request.

Returns

\Closure

retryMiddleware()

retryMiddleware() : \Closure

Return retry middleware.

Returns

\Closure

checkAndThrow()

checkAndThrow(array  $contents) 

Check the array data errors, and Throw exception when the contents contains error.

Parameters

array $contents

Throws

\EasyWeChat\Core\Exceptions\HttpException