Open Journal Systems  3.3.0
Guzzle\Service\Resource\ResourceIteratorApplyBatched Class Reference
Inheritance diagram for Guzzle\Service\Resource\ResourceIteratorApplyBatched:
Guzzle\Common\AbstractHasDispatcher Guzzle\Common\HasDispatcherInterface

Public Member Functions

 __construct (ResourceIteratorInterface $iterator, $callback)
 
 apply ($perBatch=50)
 
 getBatchCount ()
 
 getIteratedCount ()
 
- Public Member Functions inherited from Guzzle\Common\AbstractHasDispatcher
 addSubscriber (EventSubscriberInterface $subscriber)
 
 dispatch ($eventName, array $context=array())
 
 getEventDispatcher ()
 
 setEventDispatcher (EventDispatcherInterface $eventDispatcher)
 

Static Public Member Functions

static getAllEvents ()
 

Protected Attributes

 $batches = 0
 
 $callback
 
 $iterated = 0
 
 $iterator
 
- Protected Attributes inherited from Guzzle\Common\AbstractHasDispatcher
 $eventDispatcher
 

Detailed Description

Apply a callback to the contents of a {

See also
ResourceIteratorInterface}
Deprecated:
Will be removed in a future version and is no longer maintained. Use the Batch\ abstractions instead. @codeCoverageIgnore

Definition at line 16 of file ResourceIteratorApplyBatched.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Service\Resource\ResourceIteratorApplyBatched::__construct ( ResourceIteratorInterface  $iterator,
  $callback 
)
Parameters
ResourceIteratorInterface$iteratorResource iterator to apply a callback to
array | callable$callbackCallback method accepting the resource iterator and an array of the iterator's current resources

Definition at line 59 of file ResourceIteratorApplyBatched.php.

References Guzzle\Service\Resource\ResourceIteratorApplyBatched\$callback, Guzzle\Service\Resource\ResourceIteratorApplyBatched\$iterator, and Guzzle\Common\Version\warn().

Member Function Documentation

◆ apply()

Guzzle\Service\Resource\ResourceIteratorApplyBatched::apply (   $perBatch = 50)

Apply the callback to the contents of the resource iterator

Parameters
int$perBatchThe number of records to group per batch transfer
Returns
int Returns the number of iterated resources

Definition at line 73 of file ResourceIteratorApplyBatched.php.

References Guzzle\Service\Resource\ResourceIteratorApplyBatched\$batches, Guzzle\Service\Resource\ResourceIteratorApplyBatched\$callback, Guzzle\Service\Resource\ResourceIteratorApplyBatched\$iterated, Guzzle\Service\Resource\ResourceIteratorApplyBatched\$iterator, Guzzle\Common\AbstractHasDispatcher\dispatch(), and Guzzle\Batch\BatchBuilder\factory().

◆ getAllEvents()

static Guzzle\Service\Resource\ResourceIteratorApplyBatched::getAllEvents ( )
static

Get a list of all of the events emitted from the class

Returns
array

Reimplemented from Guzzle\Common\AbstractHasDispatcher.

Definition at line 42 of file ResourceIteratorApplyBatched.php.

◆ getBatchCount()

Guzzle\Service\Resource\ResourceIteratorApplyBatched::getBatchCount ( )

Get the total number of batches sent

Returns
int

Definition at line 109 of file ResourceIteratorApplyBatched.php.

References Guzzle\Service\Resource\ResourceIteratorApplyBatched\$batches.

◆ getIteratedCount()

Guzzle\Service\Resource\ResourceIteratorApplyBatched::getIteratedCount ( )

Get the total number of iterated resources

Returns
int

Definition at line 119 of file ResourceIteratorApplyBatched.php.

References Guzzle\Service\Resource\ResourceIteratorApplyBatched\$iterated.

Field Documentation

◆ $batches

integer Guzzle\Service\Resource\ResourceIteratorApplyBatched::$batches = 0
protected

◆ $callback

callable array Guzzle\Service\Resource\ResourceIteratorApplyBatched::$callback
protected

◆ $iterated

int Guzzle\Service\Resource\ResourceIteratorApplyBatched::$iterated = 0
protected

◆ $iterator

ResourceIteratorInterface Guzzle\Service\Resource\ResourceIteratorApplyBatched::$iterator
protected

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