Open Journal Systems  3.3.0
Guzzle\Batch\BatchSizeDivisor Class Reference
Inheritance diagram for Guzzle\Batch\BatchSizeDivisor:
Guzzle\Batch\BatchDivisorInterface

Public Member Functions

 __construct ($size)
 
 createBatches (\SplQueue $queue)
 
 getSize ()
 
 setSize ($size)
 

Protected Attributes

 $size
 

Detailed Description

Divides batches into smaller batches under a certain size

Definition at line 8 of file BatchSizeDivisor.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Batch\BatchSizeDivisor::__construct (   $size)
Parameters
int$sizeSize of each batch

Definition at line 17 of file BatchSizeDivisor.php.

References Guzzle\Batch\BatchSizeDivisor\$size.

Member Function Documentation

◆ createBatches()

Guzzle\Batch\BatchSizeDivisor::createBatches ( \SplQueue  $queue)

Divide a queue of items into an array batches

Parameters
\SplQueue$queueQueue 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

Implements Guzzle\Batch\BatchDivisorInterface.

Definition at line 46 of file BatchSizeDivisor.php.

◆ getSize()

Guzzle\Batch\BatchSizeDivisor::getSize ( )

Get the size of each batch

Returns
int

Definition at line 41 of file BatchSizeDivisor.php.

References Guzzle\Batch\BatchSizeDivisor\$size.

◆ setSize()

Guzzle\Batch\BatchSizeDivisor::setSize (   $size)

Set the size of each batch

Parameters
int$sizeSize of each batch
Returns
BatchSizeDivisor

Definition at line 29 of file BatchSizeDivisor.php.

References Guzzle\Batch\BatchSizeDivisor\$size.

Field Documentation

◆ $size

int Guzzle\Batch\BatchSizeDivisor::$size
protected

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