3 namespace Drupal\layout_builder;
6 * Defines the interface for an object that stores layout sections.
9 * Layout Builder is currently experimental and should only be leveraged by
10 * experimental modules and development releases of contributed modules.
11 * See https://www.drupal.org/core/experimental for more information.
13 * @see \Drupal\layout_builder\Section
15 interface SectionListInterface extends \Countable {
18 * Gets the layout sections.
20 * @return \Drupal\layout_builder\Section[]
21 * A sequentially and numerically keyed array of section objects.
23 public function getSections();
26 * Gets a domain object for the layout section.
29 * The delta of the section.
31 * @return \Drupal\layout_builder\Section
34 public function getSection($delta);
37 * Appends a new section to the end of the list.
39 * @param \Drupal\layout_builder\Section $section
40 * The section to append.
44 public function appendSection(Section $section);
47 * Inserts a new section at a given delta.
49 * If a section exists at the given index, the section at that position and
50 * others after it are shifted backward.
53 * The delta of the section.
54 * @param \Drupal\layout_builder\Section $section
55 * The section to insert.
59 public function insertSection($delta, Section $section);
62 * Removes the section at the given delta.
64 * As sections are stored sequentially and numerically this will re-key every
65 * subsequent section, shifting them forward.
68 * The delta of the section.
72 public function removeSection($delta);