You are here

protected function LayoutBuilderEntityViewDisplay::getDefaultRegion in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::getDefaultRegion()

Gets the default region.

Return value

string The default region for this display.

Overrides EntityDisplayBase::getDefaultRegion

File

core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php, line 235

Class

LayoutBuilderEntityViewDisplay
Provides an entity view display entity that has a layout.

Namespace

Drupal\layout_builder\Entity

Code

protected function getDefaultRegion() {
  if ($this
    ->hasSection(0)) {
    return $this
      ->getSection(0)
      ->getDefaultRegion();
  }
  return parent::getDefaultRegion();
}