Provides access to the results of a collection export

The cursor might not contain all results in the beginning.

If the result set is too big to be transferred in one go, the cursor might issue additional HTTP requests to fetch the remaining results from the server.

package ArangoDBClient
since 2.6

 Methods

Initialize the cursor with the first results and some metadata

__construct(\ArangoDBClient\Connection $connection, array $data, array $options) 

Parameters

$connection

\ArangoDBClient\Connection
  • connection to be used

$data

array
  • initial result data as returned by the server

$options

array
  • cursor options

Exceptions

\ArangoDBClient\ClientException

Explicitly delete the cursor

delete() : boolean

This might issue an HTTP DELETE request to inform the server about the deletion.

Exceptions

\ArangoDBClient\Exception

Returns

boolean- true if the server acknowledged the deletion request, false otherwise

Get the total number of results in the export

getCount() : integer

Returns

integer- total number of results

Return the number of HTTP calls that were made to build the cursor result

getFetches() : integer

Returns

integer

Return the cursor id, if any

getId() : string

Returns

string

Get next results as an array

getNextBatch() : mixed

This might issue additional HTTP requests to fetch any outstanding results from the server

Exceptions

\ArangoDBClient\Exception

Returns

mixed- an array with the next results or false if the cursor is exhausted

Sets the document class to use

setDocumentClass(string $class) : \ArangoDBClient\DocumentClassable
Inherited

Parameters

$class

string

Document class to use

Returns

\ArangoDBClient\DocumentClassable

Sets the edge class to use

setEdgeClass(string $class) : \ArangoDBClient\DocumentClassable
Inherited

Parameters

$class

string

Edge class to use

Returns

\ArangoDBClient\DocumentClassable

Fetch outstanding results from the server

fetchOutstanding() : void

Exceptions

\ArangoDBClient\Exception

Create an array of results from the input array

setData(array $data) : void

Parameters

$data

array
  • incoming result

Exceptions

\ArangoDBClient\ClientException

Return the base URL for the cursor

url() : string

Returns

string

 Properties

 

Document class to use

$_documentClass : string

Default

'\ArangoDBClient\Document'
 

Edge class to use

$_edgeClass : string

Default

'\ArangoDBClient\Edge'
 

The connection object

$_connection : \ArangoDBClient\Connection

Default

 

number of HTTP calls that were made to build the cursor result

$_fetches 

Default

1
 

"has more" indicator - if true, the server has more results

$_hasMore : boolean

Default

 

cursor id - might be NULL if cursor does not have an id

$_id : mixed

Default

 

Cursor options

$_options : array

Default

 

The current result set

$_result : array

Default

 Constants

 

"baseurl" option entry.

ENTRY_BASEURL = 'baseurl' 
 

result entry for document count

ENTRY_COUNT = 'count' 
 

"flat" option entry (will treat the results as a simple array, not documents)

ENTRY_FLAT = '_flat' 
 

result entry for "hasMore" flag

ENTRY_HASMORE = 'hasMore' 
 

result entry for cursor id

ENTRY_ID = 'id' 
 

result entry for result documents

ENTRY_RESULT = 'result' 
 

"type" option entry (is used when converting the result into documents or edges objects)

ENTRY_TYPE = 'type'