You are here

public function SectionListTrait::count in Drupal 10

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

File

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

Class

SectionListTrait
Provides a trait for maintaining a list of sections.

Namespace

Drupal\layout_builder

Code

public function count() {
  if ($this
    ->hasBlankSection()) {
    return 0;
  }
  return count($this
    ->getSections());
}