Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Issue #223 - Implicit fetch cursor returns empty last value
Summary: #223 When using Implicit Fetch the last object returned by Cursor is an empty, inexistant object. This was caused by a very subtle interaction with isJsonObject method. Test Plan: Sample code to detect error: use FacebookAds\Logger\CurlLogger; use FacebookAds\Object\AdAccount; use FacebookAds\Cursor; Api::instance()->setLogger(new CurlLogger()); Cursor::setDefaultUseImplicitFetch(true); $result = array(); $params = array(); $fields = array( \FacebookAds\Object\Fields\AdFields::ID, \FacebookAds\Object\Fields\AdFields::NAME, ); $account = new AdAccount($account_id); $ads = $account->getAds($fields, $params); //$ads->setUseImplicitFetch(true); foreach ($ads as $ad) { $row = []; foreach ($fields as $field) { $row[$field] = $ad->$field; } $result[] = $row; } var_dump($result);
- Loading branch information