dirkgroenen / pinterest-api-php

A PHP wrapper for the official Pinterest API. :pushpin:
https://developers.pinterest.com/docs/getting-started/introduction/
Apache License 2.0
173 stars 76 forks source link

paging #13

Closed jflefebvre closed 8 years ago

jflefebvre commented 8 years ago

Thanks for this API client. ;) I was used to webscrap data previously ... I've noticed an issue about the page property, it's always set to false even if pinterest send the data correctly.

In the Collection class line 90, if I replace the

if( is_set($this->response->page) && !empty($this->response->page['next']) ){

by

if( is_array($this->response->page) && !empty($this->response->page['next']) ){

it does the trick. The is_set always return false, weird. I'm using PHP 5.5.30.

sfai05 commented 8 years ago

+1

dirkgroenen commented 8 years ago

Thanks for the tip. I've just changed it and released the new version.

dirkgroenen commented 8 years ago

Turns out the problem was caused by the Response class not having a __isset method. I've added this one and written some extra tests and everything seems to be working now.