function LayoutBuilderEntityViewDisplay::getDefaultRegion

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

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();
}

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