BatchClosureTransfer
in package
implements
BatchTransferInterface
Batch transfer strategy where transfer logic can be defined via a Closure.
This class is to be used with BatchInterface
Table of Contents
Interfaces
- BatchTransferInterface
- Interface used for transferring batches of items
Properties
Methods
- __construct() : mixed
- transfer() : mixed
- Transfer an array of items
Properties
$callable
protected
callable
$callable
A closure that performs the transfer
$context
protected
mixed
$context
Context passed to the callable
Methods
__construct()
public
__construct(mixed $callable[, mixed $context = null ]) : mixed
Parameters
- $callable : mixed
-
Callable that performs the transfer. This function should accept two arguments: (array $batch, mixed $context).
- $context : mixed = null
-
Optional context to pass to the batch divisor
Tags
transfer()
Transfer an array of items
public
transfer(array<string|int, mixed> $batch) : mixed
Parameters
- $batch : array<string|int, mixed>
-
Array of items to transfer