Skip to content

Getting a batch with objects #9

@Niels-P

Description

@Niels-P

Hi RMUit,

I'm currently using your library to get the resources from a connector. The resource should have 1692 entries in it. I use your helper function getDataBatch to do it in batches. I'm using the REST API of AFAS. I get the following error;

Afas GetConnector returned a non-array value. (Has an unsupported Outputmode option been set?)

Which makes sense, because when debugging AFAS returns null. So for some reason it doesn't find any entities in the batch. I'm using the following code;

$client = new RestCurlClient( [ 'customerId' => ****, 'appToken' => '*****' ] );
$connection = new Connection($client);
$helper = new Helper();

$results = ['subtotal' => 0, 'finished' => false];
$test = 0;
do {
     $data = $helper->getDataBatch(['connection' => $connection, 'connector' => '****', 'id_field' => 'Verkooprelatie', 'options' => [ 'Outputmode' => Connection::GET_OUTPUTMODE_ARRAY ]], $results);
    $test++;
} while($results['finished'] == false);
dd($results);

Can you help me how to implement this method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions