BlockRepositoryInterface.php 853 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Drupal\block;
  3. interface BlockRepositoryInterface {
  4. /**
  5. * Return only visible regions.
  6. *
  7. * @see system_region_list()
  8. */
  9. const REGIONS_VISIBLE = 'visible';
  10. /**
  11. * Return all regions.
  12. *
  13. * @see system_region_list()
  14. */
  15. const REGIONS_ALL = 'all';
  16. /**
  17. * Returns an array of regions and their block entities.
  18. *
  19. * @param \Drupal\Core\Cache\CacheableMetadata[] $cacheable_metadata
  20. * (optional) List of CacheableMetadata objects, keyed by region. This is
  21. * by reference and is used to pass this information back to the caller.
  22. *
  23. * @return array
  24. * The array is first keyed by region machine name, with the values
  25. * containing an array keyed by block ID, with block entities as the values.
  26. */
  27. public function getVisibleBlocksPerRegion(array &$cacheable_metadata = []);
  28. }