diff options
Diffstat (limited to 'vendor/guzzle/guzzle/src/Guzzle/Batch/HistoryBatch.php')
-rw-r--r-- | vendor/guzzle/guzzle/src/Guzzle/Batch/HistoryBatch.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/guzzle/guzzle/src/Guzzle/Batch/HistoryBatch.php b/vendor/guzzle/guzzle/src/Guzzle/Batch/HistoryBatch.php new file mode 100644 index 0000000..e345fdc --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Batch/HistoryBatch.php @@ -0,0 +1,39 @@ +<?php + +namespace Guzzle\Batch; + +/** + * BatchInterface decorator used to keep a history of items that were added to the batch. You must clear the history + * manually to remove items from the history. + */ +class HistoryBatch extends AbstractBatchDecorator +{ + /** @var array Items in the history */ + protected $history = array(); + + public function add($item) + { + $this->history[] = $item; + $this->decoratedBatch->add($item); + + return $this; + } + + /** + * Get the batch history + * + * @return array + */ + public function getHistory() + { + return $this->history; + } + + /** + * Clear the batch history + */ + public function clearHistory() + { + $this->history = array(); + } +} |