Open Journal Systems  3.3.0
AbstractBatchDecorator.php
1 <?php
2 
3 namespace Guzzle\Batch;
4 
8 abstract class AbstractBatchDecorator implements BatchInterface
9 {
11  protected $decoratedBatch;
12 
17  {
18  $this->decoratedBatch = $decoratedBatch;
19  }
20 
30  public function __call($method, array $args)
31  {
32  return call_user_func_array(array($this->decoratedBatch, $method), $args);
33  }
34 
35  public function add($item)
36  {
37  $this->decoratedBatch->add($item);
38 
39  return $this;
40  }
41 
42  public function flush()
43  {
44  return $this->decoratedBatch->flush();
45  }
46 
47  public function isEmpty()
48  {
49  return $this->decoratedBatch->isEmpty();
50  }
51 
57  public function getDecorators()
58  {
59  $found = array($this);
60  if (method_exists($this->decoratedBatch, 'getDecorators')) {
61  $found = array_merge($found, $this->decoratedBatch->getDecorators());
62  }
63 
64  return $found;
65  }
66 }
Guzzle\Batch
Definition: AbstractBatchDecorator.php:3
Guzzle\Batch\AbstractBatchDecorator\getDecorators
getDecorators()
Definition: AbstractBatchDecorator.php:60
Guzzle\Batch\AbstractBatchDecorator\flush
flush()
Definition: AbstractBatchDecorator.php:45
Guzzle\Batch\AbstractBatchDecorator\add
add($item)
Definition: AbstractBatchDecorator.php:38
Guzzle\Batch\BatchInterface
Definition: BatchInterface.php:8
Guzzle\Batch\AbstractBatchDecorator\isEmpty
isEmpty()
Definition: AbstractBatchDecorator.php:50
Guzzle\Batch\AbstractBatchDecorator\$decoratedBatch
$decoratedBatch
Definition: AbstractBatchDecorator.php:14
Guzzle\Batch\AbstractBatchDecorator\__call
__call($method, array $args)
Definition: AbstractBatchDecorator.php:33
Guzzle\Batch\AbstractBatchDecorator
Definition: AbstractBatchDecorator.php:8
Guzzle\Batch\AbstractBatchDecorator\__construct
__construct(BatchInterface $decoratedBatch)
Definition: AbstractBatchDecorator.php:19