You are here

protected function SectionListTrait::hasBlankSection in Drupal 10

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

Indicates if this section list contains a blank section.

A blank section is used to differentiate the difference between a layout that has never been instantiated and one that has purposefully had all sections removed.

Return value

bool TRUE if the section list contains a blank section, FALSE otherwise.

See also

\Drupal\layout_builder\Plugin\Layout\BlankLayout

File

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

Class

SectionListTrait
Provides a trait for maintaining a list of sections.

Namespace

Drupal\layout_builder

Code

protected function hasBlankSection() {

  // A blank section will only ever exist when the delta is 0, as added by
  // ::removeSection().
  return $this
    ->hasSection(0) && $this
    ->getSection(0)
    ->getLayoutId() === 'layout_builder_blank';
}