1 | <?php |
||
9 | abstract class ParentDelegationBuilder implements Builder |
||
10 | { |
||
11 | /** |
||
12 | * The parent Builder, if this is a child Builder |
||
13 | * @var Builder |
||
14 | */ |
||
15 | private $parentContext; |
||
16 | |||
17 | /** |
||
18 | * Builds the configuration |
||
19 | * @return array configuration |
||
20 | */ |
||
21 | abstract public function build(); |
||
22 | |||
23 | /** |
||
24 | * @param Builder $builder |
||
25 | */ |
||
26 | public function setParentContext(Builder $builder) |
||
30 | |||
31 | /** |
||
32 | * @return Builder |
||
33 | */ |
||
34 | public function getParentContext() |
||
38 | |||
39 | /** |
||
40 | * Returns the root context |
||
41 | * @return Builder |
||
42 | */ |
||
43 | public function getRootContext() |
||
54 | |||
55 | /** |
||
56 | * If a method is missing, check to see if it exist on the $parentContext |
||
57 | * and delegate the call to it. |
||
58 | * @param string $method |
||
59 | * @param array $args |
||
60 | * @throws \Exception when a method is not found on the $parentContext |
||
61 | * @return mixed |
||
62 | */ |
||
63 | public function __call($method, $args) |
||
71 | } |
||
72 |