ArangoDB-PHP API Documentation
  • Namespace
  • Class
  • Deprecated

Namespaces

  • triagens
    • ArangoDb

Classes

  • AdminHandler
  • AqlUserFunction
  • Autoloader
  • Batch
  • BatchPart
  • BindVars
  • Collection
  • CollectionHandler
  • Connection
  • ConnectionOptions
  • Cursor
  • Database
  • DefaultValues
  • Document
  • DocumentHandler
  • Edge
  • EdgeDefinition
  • EdgeHandler
  • Endpoint
  • Export
  • ExportCursor
  • Graph
  • GraphHandler
  • Handler
  • HttpHelper
  • HttpResponse
  • QueryCacheHandler
  • QueryHandler
  • Statement
  • TraceRequest
  • TraceResponse
  • Transaction
  • Traversal
  • UpdatePolicy
  • UrlHelper
  • Urls
  • User
  • UserHandler
  • ValueValidator
  • Vertex
  • VertexHandler

Exceptions

  • ClientException
  • ConnectException
  • Exception
  • ServerException

Class Batch

Provides batching functionality


Namespace: triagens\ArangoDb
Package: triagens\ArangoDb
Since: 1.1
Located at Batch.php

Methods summary

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

    $connection

    Returns

    triagens\ArangoDb\Batch
    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

    triagens\ArangoDb\Batch
    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

    triagens\ArangoDb\Batch

    Throws

    triagens\ArangoDb\ClientException
    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

    triagens\ArangoDb\Batch
    $this
    public triagens\ArangoDb\Batch
    # setActive( )

    Sets the batch active in its associated connection.

    Sets the batch active in its associated connection.

    Returns

    triagens\ArangoDb\Batch
    $this
    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

    $state

    Returns

    triagens\ArangoDb\Batch
    $this
    public
    # getActive( triagens\ArangoDb\Connection $connection )

    Gets active batch in given connection.

    Gets active batch in given connection.

    Parameters

    $connection

    Returns


    $this
    public boolean
    # getConnectionCaptureMode( triagens\ArangoDb\Connection $connection )

    Returns true, if given connection is in batch-capture mode.

    Returns true, if given connection is in batch-capture mode.

    Parameters

    $connection

    Returns

    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

    $batchPartId

    Returns

    triagens\ArangoDb\Batch
    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

    $batchPartCursorOptions

    Returns

    triagens\ArangoDb\Batch
    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

    triagens\ArangoDb\HttpResponse

    Throws

    triagens\ArangoDb\ClientException
    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

    $pattern
    $string

    Returns

    array
    $array - Array of batch-parts

    Throws

    triagens\ArangoDb\ClientException
    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

    triagens\ArangoDb\ClientException
    triagens\ArangoDb\Exception
    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

    triagens\ArangoDb\ClientException
    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

    triagens\ArangoDb\ClientException
    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

    triagens\ArangoDb\ClientException
    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

    triagens\ArangoDb\Connection

    Properties summary

    public triagens\ArangoDb\HttpResponse $_batchResponse

    Batch Response Object

    Batch Response Object

    #
    ArangoDB-PHP API Documentation API documentation generated by ApiGen