\Guzzle\BatchBatchClosureDivisor

Divides batches using a callable

Summary

Methods
Properties
Constants
__construct()
createBatches()
No public properties found
No constants found
No protected methods found
$callable
$context
N/A
No private methods found
No private properties found
N/A

Properties

$callable

$callable : callable

Type

callable — Method used to divide the batches

$context

$context : mixed

Type

mixed — Context passed to the callable

Methods

__construct()

__construct(callable  $callable, mixed  $context = null) 

Parameters

callable $callable

Method used to divide the batches. The method must accept an \SplQueue and return an array of arrays containing the divided items.

mixed $context

Optional context to pass to the batch divisor

Throws

\Guzzle\Common\Exception\InvalidArgumentException

if the callable is not callable

createBatches()

createBatches(\SplQueue  $queue) : array|\Traversable

Divide a queue of items into an array batches

Parameters

\SplQueue $queue

Queue of items to divide into batches. Items are removed as they are iterated.

Returns

array|\Traversable —

Returns an array or Traversable object that contains arrays of items to transfer