Open Journal Systems  3.3.0
ExceptionBufferingBatch.php
1 <?php
2 
3 namespace Guzzle\Batch;
4 
6 
12 {
14  protected $exceptions = array();
15 
16  public function flush()
17  {
18  $items = array();
19 
20  while (!$this->decoratedBatch->isEmpty()) {
21  try {
22  $transferredItems = $this->decoratedBatch->flush();
23  } catch (BatchTransferException $e) {
24  $this->exceptions[] = $e;
25  $transferredItems = $e->getTransferredItems();
26  }
27  $items = array_merge($items, $transferredItems);
28  }
29 
30  return $items;
31  }
32 
38  public function getExceptions()
39  {
40  return $this->exceptions;
41  }
42 
46  public function clearExceptions()
47  {
48  $this->exceptions = array();
49  }
50 }
Guzzle\Batch
Definition: AbstractBatchDecorator.php:3
Guzzle\Batch\ExceptionBufferingBatch\getExceptions
getExceptions()
Definition: ExceptionBufferingBatch.php:41
Guzzle\Batch\ExceptionBufferingBatch
Definition: ExceptionBufferingBatch.php:11
Guzzle\Batch\ExceptionBufferingBatch\clearExceptions
clearExceptions()
Definition: ExceptionBufferingBatch.php:49
Guzzle\Batch\AbstractBatchDecorator
Definition: AbstractBatchDecorator.php:8
Guzzle\Batch\Exception\BatchTransferException
Definition: BatchTransferException.php:12
Guzzle\Batch\ExceptionBufferingBatch\flush
flush()
Definition: ExceptionBufferingBatch.php:19
Guzzle\Batch\ExceptionBufferingBatch\$exceptions
$exceptions
Definition: ExceptionBufferingBatch.php:17
Guzzle\Batch\Exception\BatchTransferException\getTransferredItems
getTransferredItems()
Definition: BatchTransferException.php:78