Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

API_CREATE

API_CREATE = 'https://api.weixin.qq.com/cgi-bin/poi/addpoi'

API_GET

API_GET = 'https://api.weixin.qq.com/cgi-bin/poi/getpoi'

API_LIST

API_LIST = 'https://api.weixin.qq.com/cgi-bin/poi/getpoilist'

API_UPDATE

API_UPDATE = 'https://api.weixin.qq.com/cgi-bin/poi/updatepoi'

API_DELETE

API_DELETE = 'https://api.weixin.qq.com/cgi-bin/poi/delpoi'

API_GET_CATEGORIES

API_GET_CATEGORIES = 'https://api.weixin.qq.com/cgi-bin/poi/getwxcategory'

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

Returns

\EasyWeChat\Support\Collection

lists()

lists(integer  $offset, integer  $limit = 10) : \EasyWeChat\Support\Collection

List POI.

Parameters

integer $offset
integer $limit

Returns

\EasyWeChat\Support\Collection

create()

create(array  $data) : boolean

Create a POI.

Parameters

array $data

Returns

boolean

createAndGetId()

createAndGetId(array  $data) : integer

Parameters

array $data

Returns

integer

update()

update(integer  $poiId, array  $data) : boolean

Update a POI.

Parameters

integer $poiId
array $data

Returns

boolean

delete()

delete(integer  $poiId) : boolean

Delete a POI.

Parameters

integer $poiId

Returns

boolean

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