php - Recursive function until done value is true and merge each response into a big one -
i have function: public function syncterritoriessoqlquery($veevatoken, $instanceurl, $tokenurl) { $soqlquery2 = "select id,name,lastmodifieddate territory"; $soqlurl2 = $instanceurl.'/services/data/v28.0/query/?q='.urlencode($soqlquery2); $curl = curl_init($soqlurl2); curl_setopt($curl, curlopt_header, false); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_httpheader, array("authorization: oauth $veevatoken")); $jsonresponse = curl_exec($curl); $status = curl_getinfo($curl, curlinfo_http_code); if ($status !== 200) { $respobj['error'] = "error: call token url $tokenurl failed status $status, response $jsonresponse, curl_error ".curl_error( $curl ).", curl_errno ".curl_errno($curl); return $respobj; } curl_close($curl); $soqlobj2 = json_decode($jsonresponse, true); return $soqlobj2; } when ca...