Class Guzzle\Service\Resource\ResourceIteratorApplyBatched

InheritanceGuzzle\Service\Resource\ResourceIteratorApplyBatched » Guzzle\Common\AbstractHasDispatcher
ImplementsGuzzle\Common\HasDispatcherInterface
Deprecated since version Will be removed in a future version and is no longer maintained. Use the Batch\ abstractions instead.

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

Property Details

$batches protected property

Total number of sent batches

protected integer $batches 0
$callback protected property
protected callable|array $callback null
$iterated protected property

Total number of iterated resources

protected int $iterated 0
$iterator protected property

Method Details

__construct() public method

public void __construct ( Guzzle\Service\Resource\ResourceIteratorInterface $iterator, $callback )
$iterator Guzzle\Service\Resource\ResourceIteratorInterface

Resource iterator to apply a callback to

$callback array|callable

Callback method accepting the resource iterator

                                       and an array of the iterator's current resources
apply() public method

Apply the callback to the contents of the resource iterator

public int apply ( $perBatch 50 )
$perBatch int

The number of records to group per batch transfer

return int

Returns the number of iterated resources

getAllEvents() public static method

public static void getAllEvents ( )
getBatchCount() public method

Get the total number of batches sent

public int getBatchCount ( )
getIteratedCount() public method

Get the total number of iterated resources

public int getIteratedCount ( )