BlockRepositoryInterface.php

Same filename and directory in other branches
  1. 8.9.x core/modules/block/src/BlockRepositoryInterface.php
  2. 10 core/modules/block/src/BlockRepositoryInterface.php
  3. 11.x core/modules/block/src/BlockRepositoryInterface.php

Namespace

Drupal\block

File

core/modules/block/src/BlockRepositoryInterface.php

View source
<?php

namespace Drupal\block;

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 = []);

}

Interfaces

Title Deprecated Summary
BlockRepositoryInterface

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.