ParentNodeDefinitionInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Config\Definition\Builder;
  11. /**
  12. * An interface that must be implemented by nodes which can have children.
  13. *
  14. * @author Victor Berchet <victor@suumit.com>
  15. */
  16. interface ParentNodeDefinitionInterface
  17. {
  18. /**
  19. * Returns a builder to add children nodes.
  20. *
  21. * @return NodeBuilder
  22. */
  23. public function children();
  24. /**
  25. * Appends a node definition.
  26. *
  27. * Usage:
  28. *
  29. * $node = $parentNode
  30. * ->children()
  31. * ->scalarNode('foo')->end()
  32. * ->scalarNode('baz')->end()
  33. * ->append($this->getBarNodeDefinition())
  34. * ->end()
  35. * ;
  36. *
  37. * @return $this
  38. */
  39. public function append(NodeDefinition $node);
  40. /**
  41. * Sets a custom children builder.
  42. */
  43. public function setBuilder(NodeBuilder $builder);
  44. }