function SimpleConfigSectionStorage::save
Same name in other branches
- 8.9.x core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage::save()
- 10 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage::save()
- 11.x core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage::save()
Overrides SectionStorageInterface::save
File
-
core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ src/ Plugin/ SectionStorage/ SimpleConfigSectionStorage.php, line 123
Class
- SimpleConfigSectionStorage
- Provides section storage utilizing simple config.
Namespace
Drupal\layout_builder_test\Plugin\SectionStorageCode
public function save() {
$sections = array_map(function (Section $section) {
return $section->toArray();
}, $this->getSections());
$config = $this->configFactory
->getEditable($this->getConfigName());
$return = $config->get('sections') ? SAVED_UPDATED : SAVED_NEW;
$config->set('sections', $sections)
->save();
return $return;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.