\Guzzle\Service\ResourceResourceIteratorApplyBatched

Apply a callback to the contents of a {@see ResourceIteratorInterface}

Summary

Methods
Properties
Constants
getAllEvents()
setEventDispatcher()
getEventDispatcher()
dispatch()
addSubscriber()
__construct()
apply()
getBatchCount()
getIteratedCount()
No public properties found
No constants found
No protected methods found
$eventDispatcher
$callback
$iterator
$batches
$iterated
N/A
No private methods found
No private properties found
N/A

Properties

$callback

$callback : callable|array

Type

callable|array

$batches

$batches : integer

Type

integer — Total number of sent batches

$iterated

$iterated : integer

Type

integer — Total number of iterated resources

Methods

getAllEvents()

getAllEvents() : array

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

Returns

array

dispatch()

dispatch(string  $eventName, array  $context = array()) : \Guzzle\Common\Event

Helper to dispatch Guzzle events and set the event name on the event

Parameters

string $eventName

Name of the event to dispatch

array $context

Context of the event

Returns

\Guzzle\Common\Event

Returns the created event object

__construct()

__construct(\Guzzle\Service\Resource\ResourceIteratorInterface  $iterator, array|callable  $callback) 

Parameters

\Guzzle\Service\Resource\ResourceIteratorInterface $iterator

Resource iterator to apply a callback to

array|callable $callback

Callback method accepting the resource iterator and an array of the iterator's current resources

apply()

apply(integer  $perBatch = 50) : integer

Apply the callback to the contents of the resource iterator

Parameters

integer $perBatch

The number of records to group per batch transfer

Returns

integer —

Returns the number of iterated resources

getBatchCount()

getBatchCount() : integer

Get the total number of batches sent

Returns

integer

getIteratedCount()

getIteratedCount() : integer

Get the total number of iterated resources

Returns

integer