EntityTypeBundleInfoInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. /**
  4. * Provides an interface for an entity type bundle info.
  5. */
  6. interface EntityTypeBundleInfoInterface {
  7. /**
  8. * Get the bundle info of all entity types.
  9. *
  10. * @return array
  11. * An array of bundle information where the outer array is keyed by entity
  12. * type. The next level is keyed by the bundle name. The inner arrays are
  13. * associative arrays of bundle information, such as the label for the
  14. * bundle.
  15. */
  16. public function getAllBundleInfo();
  17. /**
  18. * Gets the bundle info of an entity type.
  19. *
  20. * @param string $entity_type_id
  21. * The entity type ID.
  22. *
  23. * @return array
  24. * An array of bundle information where the outer array is keyed by the
  25. * bundle name, or the entity type name if the entity does not have bundles.
  26. * The inner arrays are associative arrays of bundle information, such as
  27. * the label for the bundle.
  28. */
  29. public function getBundleInfo($entity_type_id);
  30. /**
  31. * Clears static and persistent bundles.
  32. */
  33. public function clearCachedBundles();
  34. }