Documentation

ResourceIteratorApplyBatched extends AbstractHasDispatcher
in package

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

Tags
deprecated

Will be removed in a future version and is no longer maintained. Use the Batch\ abstractions instead.

codeCoverageIgnore

Table of Contents

$batches  : int
$callback  : callable|array<string|int, mixed>
$eventDispatcher  : EventDispatcherInterface
$iterated  : int
$iterator  : ResourceIteratorInterface
__construct()  : mixed
addSubscriber()  : self
Add an event subscriber to the dispatcher
apply()  : int
Apply the callback to the contents of the resource iterator
dispatch()  : Event
Helper to dispatch Guzzle events and set the event name on the event
getAllEvents()  : array<string|int, mixed>
Get a list of all of the events emitted from the class
getBatchCount()  : int
Get the total number of batches sent
getEventDispatcher()  : EventDispatcherInterface
Get the EventDispatcher of the request
getIteratedCount()  : int
Get the total number of iterated resources
setEventDispatcher()  : self
Set the EventDispatcher of the request

Properties

Methods

__construct()

public __construct(ResourceIteratorInterface $iterator, array<string|int, mixed>|callable $callback) : mixed
Parameters
$iterator : ResourceIteratorInterface

Resource iterator to apply a callback to

$callback : array<string|int, mixed>|callable

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

Return values
mixed —

apply()

Apply the callback to the contents of the resource iterator

public apply([int $perBatch = 50 ]) : int
Parameters
$perBatch : int = 50

The number of records to group per batch transfer

Return values
int —

Returns the number of iterated resources

dispatch()

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

public dispatch(mixed $eventName[, array<string|int, mixed> $context = array() ]) : Event
Parameters
$eventName : mixed

Name of the event to dispatch

$context : array<string|int, mixed> = array()

Context of the event

Return values
Event —

Returns the created event object

getAllEvents()

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

public static getAllEvents() : array<string|int, mixed>
Return values
array<string|int, mixed> —

Search results