Same name and namespace in other branches
  1. 8.9.x core/modules/block/src/BlockRepositoryInterface.php \Drupal\block\BlockRepositoryInterface
  2. 9 core/modules/block/src/BlockRepositoryInterface.php \Drupal\block\BlockRepositoryInterface

Hierarchy

Expanded class hierarchy of BlockRepositoryInterface

All classes that implement BlockRepositoryInterface

File

core/modules/block/src/BlockRepositoryInterface.php, line 5

Namespace

Drupal\block
View source
interface BlockRepositoryInterface {

  /**
   * Return only visible regions.
   *
   * @see system_region_list()
   */
  const REGIONS_VISIBLE = 'visible';

  /**
   * Return all regions.
   *
   * @see system_region_list()
   */
  const REGIONS_ALL = 'all';

  /**
   * Returns an array of regions and their block entities.
   *
   * @param \Drupal\Core\Cache\CacheableMetadata[] $cacheable_metadata
   *   (optional) List of CacheableMetadata objects, keyed by region. This is
   *   by reference and is used to pass this information back to the caller.
   *
   * @return array
   *   The array is first keyed by region machine name, with the values
   *   containing an array keyed by block ID, with block entities as the values.
   */
  public function getVisibleBlocksPerRegion(array &$cacheable_metadata = []);

  /**
   * Based on a suggested string generates a unique machine name for a block.
   *
   * @param string $suggestion
   *   The suggested block ID.
   * @param string $theme
   *   The machine name of the theme.
   *
   * @return string
   *   Returns the unique name.
   */
  public function getUniqueMachineName(string $suggestion, string $theme) : string;

}

Members

Namesort descending Modifiers Type Description Overrides
BlockRepositoryInterface::getUniqueMachineName public function Based on a suggested string generates a unique machine name for a block.
BlockRepositoryInterface::getVisibleBlocksPerRegion public function Returns an array of regions and their block entities.
BlockRepositoryInterface::REGIONS_ALL constant Return all regions.
BlockRepositoryInterface::REGIONS_VISIBLE constant Return only visible regions.