ParentNodeDefinitionInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. * @method NodeDefinition[] getChildNodeDefinitions() Gets the child node definitions - not implementing it is deprecated since Symfony 4.2
  17. */
  18. interface ParentNodeDefinitionInterface extends BuilderAwareInterface
  19. {
  20. /**
  21. * Returns a builder to add children nodes.
  22. *
  23. * @return NodeBuilder
  24. */
  25. public function children();
  26. /**
  27. * Appends a node definition.
  28. *
  29. * Usage:
  30. *
  31. * $node = $parentNode
  32. * ->children()
  33. * ->scalarNode('foo')->end()
  34. * ->scalarNode('baz')->end()
  35. * ->append($this->getBarNodeDefinition())
  36. * ->end()
  37. * ;
  38. *
  39. * @return $this
  40. */
  41. public function append(NodeDefinition $node);
  42. }