BlockRepositoryInterface.php 841 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php

/**
 * @file
 * Contains \Drupal\block\BlockRepositoryInterface.
 */

namespace Drupal\block;

interface BlockRepositoryInterface {

  /**
   * Returns an array of regions and their block entities.
   *
15 16
   * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
   *   An array of contexts to set on the blocks.
17 18 19
   * @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.
20
   *
21 22 23 24
   * @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.
   */
25
  public function getVisibleBlocksPerRegion(array $contexts, array &$cacheable_metadata = []);
26 27

}