Open Journal Systems  3.3.0
Guzzle\Batch\BatchClosureTransfer Class Reference
Inheritance diagram for Guzzle\Batch\BatchClosureTransfer:
Guzzle\Batch\BatchTransferInterface

Public Member Functions

 __construct ($callable, $context=null)
 
 transfer (array $batch)
 

Protected Attributes

 $callable
 
 $context
 

Detailed Description

Batch transfer strategy where transfer logic can be defined via a Closure. This class is to be used with {

See also
Guzzle\Batch\BatchInterface}

Definition at line 11 of file BatchClosureTransfer.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Batch\BatchClosureTransfer::__construct (   $callable,
  $context = null 
)
Parameters
mixed$callableCallable that performs the transfer. This function should accept two arguments: (array $batch, mixed $context).
mixed$contextOptional context to pass to the batch divisor
Exceptions
InvalidArgumentException

Definition at line 32 of file BatchClosureTransfer.php.

References Guzzle\Batch\BatchClosureTransfer\$callable, and Guzzle\Batch\BatchClosureTransfer\$context.

Member Function Documentation

◆ transfer()

Guzzle\Batch\BatchClosureTransfer::transfer ( array  $batch)

Transfer an array of items

Parameters
array$batchArray of items to transfer

Implements Guzzle\Batch\BatchTransferInterface.

Definition at line 42 of file BatchClosureTransfer.php.

Field Documentation

◆ $callable

callable Guzzle\Batch\BatchClosureTransfer::$callable
protected

A closure that performs the transfer

Definition at line 17 of file BatchClosureTransfer.php.

Referenced by Guzzle\Batch\BatchClosureTransfer\__construct().

◆ $context

mixed Guzzle\Batch\BatchClosureTransfer::$context
protected

$context Context passed to the callable

Definition at line 23 of file BatchClosureTransfer.php.

Referenced by Guzzle\Batch\BatchClosureTransfer\__construct().


The documentation for this class was generated from the following file: