public
|
#
__construct( triagens\ArangoDb\Connection $connection, array $options = [] )
Constructor for Batch instance. Batch instance by default starts capturing request after initiated.
To disable this, pass startCapture=>false inside the options array parameter
Constructor for Batch instance. Batch instance by default starts capturing request after initiated.
To disable this, pass startCapture=>false inside the options array parameter
Parameters
- $connection
- that this batch class will monitor for requests in order to batch them. Connection parameter is mandatory.
- $options
An array of options for Batch construction. See below for options:
Options are :
- '_sanitize' - True to remove _id and _rev attributes from result documents returned from this batch. Defaults to false.
- 'startCapture' - Start batch capturing immediately after batch instantiation. Defaults to true.
- 'batchSize' - Defines a fixed array size for holding the batch parts. The id's of the batch parts can only be integers.
When this option is defined, the batch mechanism will use an SplFixedArray instead of the normal PHP arrays.
In most cases, this will result in increased performance of about 5% to 15%, depending on batch size and data.
|
public
triagens\ArangoDb\Batch
|
#
setConnection( triagens\ArangoDb\Connection $connection )
Sets the connection for he current batch. (mostly internal function)
Sets the connection for he current batch. (mostly internal function)
Parameters
Returns
|
public
triagens\ArangoDb\Batch
|
#
startCapture( )
Start capturing requests. To stop capturing, use stopCapture()
Start capturing requests. To stop capturing, use stopCapture()
see triagens\ArangoDb\Batch::stopCapture()
Returns
|
public
triagens\ArangoDb\Batch
|
#
stopCapture( )
Stop capturing requests. If the batch has not been processed yet, more requests can be appended by calling startCapture() again.
Stop capturing requests. If the batch has not been processed yet, more requests can be appended by calling startCapture() again.
see Batch::startCapture()
Returns
Throws
|
public
boolean
|
#
isActive( )
Returns true, if this batch is active in its associated connection.
Returns true, if this batch is active in its associated connection.
Returns
boolean
|
public
boolean
|
#
isCapturing( )
Returns true, if this batch is capturing requests.
Returns true, if this batch is capturing requests.
Returns
boolean
|
public
triagens\ArangoDb\Batch
|
#
activate( )
Activates the batch. This sets the batch active in its associated connection and also starts capturing.
Activates the batch. This sets the batch active in its associated connection and also starts capturing.
Returns
|
public
triagens\ArangoDb\Batch
|
#
setActive( )
Sets the batch active in its associated connection.
Sets the batch active in its associated connection.
Returns
|
public
triagens\ArangoDb\Batch
|
#
setCapture( boolean $state )
Sets the batch's associated connection into capture mode.
Sets the batch's associated connection into capture mode.
Parameters
Returns
|
public
|
|
public
boolean
|
|
public
triagens\ArangoDb\Batch
|
#
nextBatchPartId( mixed $batchPartId )
Sets the id of the next batch-part. The id can later be used to retrieve the batch-part.
Sets the id of the next batch-part. The id can later be used to retrieve the batch-part.
Parameters
Returns
|
public
triagens\ArangoDb\Batch
|
#
nextBatchPartCursorOptions( mixed $batchPartCursorOptions )
Set client side cursor options (for example: sanitize) for the next batch part.
Set client side cursor options (for example: sanitize) for the next batch part.
Parameters
Returns
|
public
triagens\ArangoDb\HttpResponse
|
#
append( mixed $method, mixed $request )
Append the request to the batch-part
Append the request to the batch-part
Parameters
- $method
- The method of the request (GET, POST...)
- $request
- The request that will get appended to the batch
Returns
Throws
|
public
array
|
#
splitWithContentIdKey( mixed $pattern, mixed $string )
Split batch request and use ContentId as array key
Split batch request and use ContentId as array key
Parameters
Returns
array $array - Array of batch-parts
Throws
|
public
triagens\ArangoDb\HttpResponse |triagens\ArangoDb\Batch
|
#
process( )
Processes this batch. This sends the captured requests to the server as one batch.
Processes this batch. This sends the captured requests to the server as one batch.
Returns
triagens\ArangoDb\HttpResponse | triagens\ArangoDb\Batch
- Batch if processing of the batch was successful or the HttpResponse object in case of a failure. A successful process just means that tha parts were processed. Each part has it's own response though and should be checked on its own.
Throws
|
public
integer
|
#
countParts( )
Get the total count of the batch parts
Get the total count of the batch parts
Returns
integer $count
|
public
mixed
|
#
getPart( mixed $partId )
Get the batch part identified by the array key (0...n) or its id (if it was set with nextBatchPartId($id) )
Get the batch part identified by the array key (0...n) or its id (if it was set with nextBatchPartId($id) )
Parameters
- $partId
- the batch part id. Either it's numeric key or a given name.
Returns
mixed $batchPart
Throws
|
public
mixed
|
#
getPartResponse( mixed $partId )
Get the batch part identified by the array key (0...n) or its id (if it was set with nextBatchPartId($id) )
Get the batch part identified by the array key (0...n) or its id (if it was set with nextBatchPartId($id) )
Parameters
- $partId
- the batch part id. Either it's numeric key or a given name.
Returns
mixed $partId
Throws
|
public
mixed
|
#
getProcessedPartResponse( mixed $partId )
Get the batch part identified by the array key (0...n) or its id (if it was set with nextBatchPartId($id) )
Get the batch part identified by the array key (0...n) or its id (if it was set with nextBatchPartId($id) )
Parameters
- $partId
- the batch part id. Either it's numeric key or a given name.
Returns
mixed $partId
Throws
|
public
array
|
#
getBatchParts( )
Returns the array of batch-parts
Returns the array of batch-parts
Returns
array $_batchParts
|
public
triagens\ArangoDb\Connection
|
#
getConnection( )
Return this batch's connection
Return this batch's connection
Returns
|