ParentNodeDefinitionInterface.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 extends BuilderAwareInterface
  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. * Gets the child node definitions.
  42. *
  43. * @return NodeDefinition[]
  44. */
  45. public function getChildNodeDefinitions();
  46. }