function ConfigureSectionForm::getCurrentSection

Same name in other branches
  1. 10 core/modules/layout_builder/src/Form/ConfigureSectionForm.php \Drupal\layout_builder\Form\ConfigureSectionForm::getCurrentSection()
  2. 11.x core/modules/layout_builder/src/Form/ConfigureSectionForm.php \Drupal\layout_builder\Form\ConfigureSectionForm::getCurrentSection()

Retrieves the section being modified by the form.

Return value

\Drupal\layout_builder\Section The section for the current form.

2 calls to ConfigureSectionForm::getCurrentSection()
ConfigureSectionForm::buildForm in core/modules/layout_builder/src/Form/ConfigureSectionForm.php
Form constructor.
ConfigureSectionForm::submitForm in core/modules/layout_builder/src/Form/ConfigureSectionForm.php
Form submission handler.

File

core/modules/layout_builder/src/Form/ConfigureSectionForm.php, line 263

Class

ConfigureSectionForm
Provides a form for configuring a layout section.

Namespace

Drupal\layout_builder\Form

Code

public function getCurrentSection() : Section {
    if (!isset($this->section)) {
        if ($this->isUpdate) {
            $this->section = $this->sectionStorage
                ->getSection($this->delta);
        }
        else {
            $this->section = new Section($this->pluginId);
        }
    }
    return $this->section;
}

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