sectionList = $section_list; return $this; } /** * Gets the section list. * * @return \Drupal\layout_builder\SectionListInterface * The section list. * * @throws \RuntimeException * Thrown if ::setSectionList() is not called first. */ protected function getSectionList() { if (!$this->sectionList) { throw new \RuntimeException(sprintf('%s::setSectionList() must be called first', static::class)); } return $this->sectionList; } /** * {@inheritdoc} */ public function getStorageType() { return $this->getPluginId(); } /** * {@inheritdoc} */ public function count() { return $this->getSectionList()->count(); } /** * {@inheritdoc} */ public function getSections() { return $this->getSectionList()->getSections(); } /** * {@inheritdoc} */ public function getSection($delta) { return $this->getSectionList()->getSection($delta); } /** * {@inheritdoc} */ public function appendSection(Section $section) { $this->getSectionList()->appendSection($section); return $this; } /** * {@inheritdoc} */ public function insertSection($delta, Section $section) { $this->getSectionList()->insertSection($delta, $section); return $this; } /** * {@inheritdoc} */ public function removeSection($delta) { $this->getSectionList()->removeSection($delta); return $this; } }