TypedConfigInterface.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace Drupal\Core\Config\Schema;
  3. use Drupal\Core\TypedData\TraversableTypedDataInterface;
  4. /**
  5. * Interface for a typed configuration object that contains multiple elements.
  6. *
  7. * A list of typed configuration contains any number of items whose type
  8. * will depend on the configuration schema but also on the configuration
  9. * data being parsed.
  10. *
  11. * When implementing this interface which extends Traversable, make sure to list
  12. * IteratorAggregate or Iterator before this interface in the implements clause.
  13. */
  14. interface TypedConfigInterface extends TraversableTypedDataInterface {
  15. /**
  16. * Determines whether the data structure is empty.
  17. *
  18. * @return bool
  19. * TRUE if the data structure is empty, FALSE otherwise.
  20. */
  21. public function isEmpty();
  22. /**
  23. * Gets an array of contained elements.
  24. *
  25. * @return array
  26. * Array of \Drupal\Core\TypedData\TypedDataInterface objects.
  27. */
  28. public function getElements();
  29. /**
  30. * Gets a contained typed configuration element.
  31. *
  32. * @param $name
  33. * The name of the property to get; e.g., 'title' or 'name'. Nested
  34. * elements can be get using multiple dot delimited names, for example,
  35. * 'page.front'.
  36. *
  37. * @return \Drupal\Core\TypedData\TypedDataInterface
  38. * The property object.
  39. *
  40. * @throws \InvalidArgumentException
  41. * If an invalid property name is given.
  42. */
  43. public function get($name);
  44. /**
  45. * Returns an array of all property values.
  46. *
  47. * @return array
  48. * An array of property values, keyed by property name.
  49. */
  50. public function toArray();
  51. }