public function Display::getSortedBlocksByRegion

Implements BoundDisplayInterface::getSortedBlocksByRegion().

Throws

\Exception

Overrides BoundDisplayInterface::getSortedBlocksByRegion

File

drupal/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/Display.php, line 76
Definition of Drupal\layout\Plugin\Core\Entity\Display.

Class

Display
Defines the display entity.

Namespace

Drupal\layout\Plugin\Core\Entity

Code

public function getSortedBlocksByRegion($region) {
  if ($this->blocksInRegions === NULL) {
    $this
      ->sortBlocks();
  }
  if (!isset($this->blocksInRegions[$region])) {
    throw new \Exception(sprintf("Region %region does not exist in layout %layout", array(
      '%region' => $region,
      '%layout' => $this
        ->getLayoutInstance()->name,
    )), E_RECOVERABLE_ERROR);
  }
  return $this->blocksInRegions[$region];
}