1 | <?php namespace BuildR\Utils\Extension; |
||
19 | abstract class AbstractExtensionReceiver implements ExtensionReceiverInterface { |
||
20 | |||
21 | /** |
||
22 | * @type \BuildR\Utils\Extension\ObjectExtensionInterface[] |
||
23 | */ |
||
24 | protected $extensions = []; |
||
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | 2 | public function __call($name, $arguments) { |
|
30 | 2 | foreach($this->extensions as $extension) { |
|
31 | 2 | if($extension->hasMethod($name)) { |
|
32 | 2 | $result = $extension->runMethod($name, $this->getCurrentValue(), $arguments); |
|
33 | 2 | return $this->processResult($result); |
|
34 | } |
||
35 | } |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * {@inheritDoc} |
||
40 | */ |
||
41 | 4 | public function loadExtension(ObjectExtensionInterface $extension) { |
|
56 | |||
57 | /** |
||
58 | * {@inheritDoc} |
||
59 | */ |
||
60 | 4 | public function isExtensionLoaded(ObjectExtensionInterface $extension) { |
|
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | 1 | public function getAllLoadedExtension() { |
|
70 | |||
71 | } |
||
72 |