1 | <?php |
||
15 | abstract class AbstractNode implements NodeInterface |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * List of Child Nodes. |
||
20 | * |
||
21 | * @var NodeInterface[] |
||
22 | */ |
||
23 | protected $childNodes = []; |
||
24 | |||
25 | /** |
||
26 | * @var boolean |
||
27 | */ |
||
28 | protected $escapeOutput = false; |
||
29 | |||
30 | /** |
||
31 | * Evaluate all child nodes and return the evaluated results. |
||
32 | * |
||
33 | * @param RenderingContextInterface $renderingContext |
||
34 | * @return mixed Normally, an object is returned - in case it is concatenated with a string, a string is returned. |
||
35 | * @throws Parser\Exception |
||
36 | */ |
||
37 | public function evaluateChildNodes(RenderingContextInterface $renderingContext) |
||
53 | |||
54 | /** |
||
55 | * @param NodeInterface $node |
||
56 | * @param RenderingContextInterface $renderingContext |
||
57 | * @param boolean $cast |
||
58 | * @return mixed |
||
59 | */ |
||
60 | protected function evaluateChildNode(NodeInterface $node, RenderingContextInterface $renderingContext, $cast) |
||
74 | |||
75 | /** |
||
76 | * Returns all child nodes for a given node. |
||
77 | * This is especially needed to implement the boolean expression language. |
||
78 | * |
||
79 | * @return NodeInterface[] A list of nodes |
||
80 | */ |
||
81 | public function getChildNodes() |
||
85 | |||
86 | /** |
||
87 | * Appends a sub node to this node. Is used inside the parser to append children |
||
88 | * |
||
89 | * @param NodeInterface $childNode The sub node to add |
||
90 | * @return void |
||
91 | */ |
||
92 | public function addChildNode(NodeInterface $childNode) |
||
96 | |||
97 | /** |
||
98 | * Specifies, if this node's output should be escaped |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function isEscapeOutputEnabled() |
||
106 | |||
107 | /** |
||
108 | * @param bool $escapeOutput |
||
109 | */ |
||
110 | public function setEscapeOutput($escapeOutput) |
||
114 | |||
115 | } |
||
116 |