1: <?php
2:
3: namespace Guzzle\Batch;
4:
5: /**
6: * BatchInterface decorator used to keep a history of items that were added to the batch. You must clear the history
7: * manually to remove items from the history.
8: */
9: class HistoryBatch extends AbstractBatchDecorator
10: {
11: /**
12: * @var array Items in the history
13: */
14: protected $history = array();
15:
16: /**
17: * {@inheritdoc}
18: */
19: public function add($item)
20: {
21: $this->history[] = $item;
22: $this->decoratedBatch->add($item);
23:
24: return $this;
25: }
26:
27: /**
28: * Get the batch history
29: *
30: * @return array
31: */
32: public function getHistory()
33: {
34: return $this->history;
35: }
36:
37: /**
38: * Clear the batch history
39: */
40: public function clearHistory()
41: {
42: $this->history = array();
43: }
44: }
45: