\triagens\ArangoDbCursor

Provides access to the results of a read-only statement

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.

Summary

Methods
Properties
Constants
__construct()
delete()
getCount()
getFullCount()
getAll()
rewind()
current()
key()
next()
valid()
getMetadata()
No public properties found
ENTRY_ID
ENTRY_HASMORE
ENTRY_RESULT
FULL_COUNT
ENTRY_SANITIZE
ENTRY_FLAT
ENTRY_TYPE
No protected methods found
No protected properties found
N/A
add()
addFlatFromArray()
addDocumentsFromArray()
addPathsFromArray()
addShortestPathFromArray()
addDistanceToFromArray()
addCommonNeighborsFromArray()
addCommonPropertiesFromArray()
addFigureFromArray()
addEdgesFromArray()
addVerticesFromArray()
sanitize()
fetchOutstanding()
updateLength()
$_connection
$_options
$_result
$_hasMore
$_id
$_position
$_length
$_fullCount
N/A

Constants

ENTRY_ID

ENTRY_ID

result entry for cursor id

ENTRY_HASMORE

ENTRY_HASMORE

result entry for "hasMore" flag

ENTRY_RESULT

ENTRY_RESULT

result entry for result documents

FULL_COUNT

FULL_COUNT

result entry for the full count (ignoring the outermost LIMIT)

ENTRY_SANITIZE

ENTRY_SANITIZE

sanitize option entry

ENTRY_FLAT

ENTRY_FLAT

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

ENTRY_TYPE

ENTRY_TYPE

"objectType" option entry.

Properties

$_options

$_options : array

Cursor options

Type

array

$_result

$_result : array

The result set

Type

array

$_hasMore

$_hasMore : boolean

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

Type

boolean

$_id

$_id : mixed

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

Type

mixed

$_position

$_position : integer

current position in result set iteration (zero-based)

Type

integer

$_length

$_length : integer

total length of result set (in number of documents)

Type

integer

$_fullCount

$_fullCount : integer

full count of the result set (ignoring the outermost LIMIT)

Type

integer

Methods

__construct()

__construct(\triagens\ArangoDb\Connection $connection, array $data, array $options) : \triagens\ArangoDb\Cursor

Initialise the cursor with the first results and some metadata

Parameters

\triagens\ArangoDb\Connection $connection
  • connection to be used
array $data
  • initial result data as returned by the server
array $options
  • cursor options

Returns

\triagens\ArangoDb\Cursor

delete()

delete() : boolean

Explicitly delete the cursor

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

Throws

\triagens\ArangoDb\Exception

Returns

boolean —
  • true if the server acknowledged the deletion request, false otherwise

getCount()

getCount() : integer

Get the total number of results in the cursor

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

Throws

\triagens\ArangoDb\Exception

Returns

integer —
  • total number of results

getFullCount()

getFullCount() : integer

Get the full count of the cursor (ignoring the outermost LIMIT)

Returns

integer —
  • total number of results

getAll()

getAll() : array

Get all results as an array

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

Throws

\triagens\ArangoDb\Exception

Returns

array —
  • an array of all results

rewind()

rewind() : void

Rewind the cursor, necessary for Iterator

current()

current() : array

Return the current result row, necessary for Iterator

Returns

array —
  • the current result row as an assoc array

key()

key() : integer

Return the index of the current result row, necessary for Iterator

Returns

integer —
  • the current result row index

next()

next() : void

Advance the cursor, necessary for Iterator

valid()

valid() : boolean

Check if cursor can be advanced further, necessary for Iterator

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

Throws

\triagens\ArangoDb\Exception

Returns

boolean —
  • true if the cursor can be advanced further, false if cursor is at end

getMetadata()

getMetadata() : array

Get MetaData of the current cursor

Returns

array

add()

add(array $data) : void

Create an array of results from the input array

Parameters

array $data
  • incoming result

addFlatFromArray()

addFlatFromArray(array $data) : void

Create an array of results from the input array

Parameters

array $data
  • array of incoming results

addDocumentsFromArray()

addDocumentsFromArray(array $data) : void

Create an array of documents from the input array

Parameters

array $data
  • array of incoming "document" arrays

addPathsFromArray()

addPathsFromArray(array $data) : void

Create an array of paths from the input array

Parameters

array $data
  • array of incoming "paths" arrays

addShortestPathFromArray()

addShortestPathFromArray(array $data) : void

Create an array of shortest paths from the input array

Parameters

array $data
  • array of incoming "paths" arrays

addDistanceToFromArray()

addDistanceToFromArray(array $data) : void

Create an array of distances from the input array

Parameters

array $data
  • array of incoming "paths" arrays

addCommonNeighborsFromArray()

addCommonNeighborsFromArray(array $data) : void

Create an array of common neighbors from the input array

Parameters

array $data
  • array of incoming "paths" arrays

addCommonPropertiesFromArray()

addCommonPropertiesFromArray(array $data) : void

Create an array of common properties from the input array

Parameters

array $data
  • array of incoming "paths" arrays

addFigureFromArray()

addFigureFromArray(array $data) : void

Create an array of figuresfrom the input array

Parameters

array $data
  • array of incoming "paths" arrays

addEdgesFromArray()

addEdgesFromArray(array $data) : void

Create an array of Edges from the input array

Parameters

array $data
  • array of incoming "edge" arrays

addVerticesFromArray()

addVerticesFromArray(array $data) : void

Create an array of Vertex from the input array

Parameters

array $data
  • array of incoming "vertex" arrays

sanitize()

sanitize(array $rows) : array

Sanitize the result set rows

This will remove the _id and _rev attributes from the results if the "sanitize" option is set

Parameters

array $rows
  • array of rows to be sanitized

Returns

array —
  • sanitized rows

fetchOutstanding()

fetchOutstanding() : void

Fetch outstanding results from the server

Throws

\triagens\ArangoDb\Exception

updateLength()

updateLength() : void

Set the length of the (fetched) result set