| @@ 42-52 (lines=11) @@ | ||
| 39 | * |
|
| 40 | * @throws \Exception |
|
| 41 | */ |
|
| 42 | public function addToArrayNode(AbstractNode $node, bool $allowDefault = false): QueryBuilderInterface |
|
| 43 | { |
|
| 44 | if (!$this->node instanceof ArrayNode) { |
|
| 45 | throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node))); |
|
| 46 | } |
|
| 47 | ||
| 48 | $this->node->add($node, $allowDefault); |
|
| 49 | $this->reassignParent($node); |
|
| 50 | ||
| 51 | return $this; |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * @param string $key |
|
| @@ 63-73 (lines=11) @@ | ||
| 60 | * |
|
| 61 | * @throws \Exception |
|
| 62 | */ |
|
| 63 | public function addToObjectNode(string $key, AbstractNode $node, bool $allowDefault = false): QueryBuilderInterface |
|
| 64 | { |
|
| 65 | if (!$this->node instanceof ObjectNode) { |
|
| 66 | throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node))); |
|
| 67 | } |
|
| 68 | ||
| 69 | $this->node->add($key, $node, $allowDefault); |
|
| 70 | $this->reassignParent($node); |
|
| 71 | ||
| 72 | return $this; |
|
| 73 | } |
|
| 74 | ||
| 75 | /** |
|
| 76 | * @param AbstractNode $node |
|