Hi I have the following function pulling data from a API. Sadly there is a limit at the API, that i can only pull 500 entries. I cant query the API for a total number for entires. What i need help for is, how i can make it query the API and save the data, untill it has all entires.
public function loadAccounts() {
$startid = -1;
$xml = '
<queryxml>
<entity>Account</entity>
<query>
<field>id<expression op="greaterthan">'. $startid .'</expression></field>
</query>
</queryxml>
';
$query = new query ( $xml );
$result = $this->client->query ( $query );
$this->accounts = Array ();
$laccounts = $result->queryResult->EntityResults->Entity;
foreach ( $laccounts as $account ) {
$this->accounts [$account->id] = $account;
}
Can someone help me setting the code up, so it will re-quey untill it has all entries?