ExceptionBufferingBatch
extends AbstractBatchDecorator
in package
BatchInterface decorator used to buffer exceptions encountered during a transfer. The exceptions can then later be processed after a batch flush has completed.
Table of Contents
Properties
- $decoratedBatch : BatchInterface
- $exceptions : array<string|int, mixed>
Methods
- __call() : mixed
- Allow decorators to implement custom methods
- __construct() : mixed
- add() : self
- Add an item to the queue
- clearExceptions() : mixed
- Clear the buffered exceptions
- flush() : array<string|int, mixed>
- Flush the batch and transfer the items
- getDecorators() : array<string|int, mixed>
- Trace the decorators associated with the batch
- getExceptions() : array<string|int, mixed>
- Get the buffered exceptions
- isEmpty() : bool
- Check if the batch is empty and has further items to transfer
Properties
$decoratedBatch
protected
BatchInterface
$decoratedBatch
Decorated batch object
$exceptions
protected
array<string|int, mixed>
$exceptions
= array()
Array of BatchTransferException exceptions
Methods
__call()
Allow decorators to implement custom methods
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
-
Missing method name
- $args : array<string|int, mixed>
-
Method arguments
Tags
__construct()
public
__construct(BatchInterface $decoratedBatch) : mixed
Parameters
- $decoratedBatch : BatchInterface
-
BatchInterface that is being decorated
add()
Add an item to the queue
public
add(mixed $item) : self
Parameters
- $item : mixed
-
Item to add
Return values
selfclearExceptions()
Clear the buffered exceptions
public
clearExceptions() : mixed
flush()
Flush the batch and transfer the items
public
flush() : array<string|int, mixed>
Return values
array<string|int, mixed> —Returns an array flushed items
getDecorators()
Trace the decorators associated with the batch
public
getDecorators() : array<string|int, mixed>
Return values
array<string|int, mixed>getExceptions()
Get the buffered exceptions
public
getExceptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of BatchTransferException objects
isEmpty()
Check if the batch is empty and has further items to transfer
public
isEmpty() : bool