function SectionListTrait::hasSection

Same name and namespace in other branches
  1. 11.x core/modules/layout_builder/src/SectionListTrait.php \Drupal\layout_builder\SectionListTrait::hasSection()
  2. 10 core/modules/layout_builder/src/SectionListTrait.php \Drupal\layout_builder\SectionListTrait::hasSection()

Indicates if there is a section at the specified delta.

Parameters

int $delta: The delta of the section.

Return value

bool TRUE if there is a section for this delta, FALSE otherwise.

File

core/modules/layout_builder/src/SectionListTrait.php, line 169

Class

SectionListTrait
Provides a trait for maintaining a list of sections.

Namespace

Drupal\layout_builder

Code

protected function hasSection($delta) {
  return isset($this->getSections()[$delta]);
}

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