class SectionStorage
Same name in other branches
- 9 core/modules/layout_builder/src/Annotation/SectionStorage.php \Drupal\layout_builder\Annotation\SectionStorage
- 8.9.x core/modules/layout_builder/src/Annotation/SectionStorage.php \Drupal\layout_builder\Annotation\SectionStorage
- 11.x core/modules/layout_builder/src/Annotation/SectionStorage.php \Drupal\layout_builder\Annotation\SectionStorage
- 11.x core/modules/layout_builder/src/Attribute/SectionStorage.php \Drupal\layout_builder\Attribute\SectionStorage
Defines a SectionStorage attribute.
Plugin Namespace: Plugin\SectionStorage
Attributes
#[\Attribute(\Attribute::TARGET_CLASS)]
Hierarchy
- class \Drupal\layout_builder\Attribute\SectionStorage extends \Drupal\Component\Plugin\Attribute\Plugin
Expanded class hierarchy of SectionStorage
See also
\Drupal\layout_builder\SectionStorage\SectionStorageManager
6 files declare their use of SectionStorage
- DefaultsSectionStorage.php in core/
modules/ layout_builder/ src/ Plugin/ SectionStorage/ DefaultsSectionStorage.php - NavigationSectionStorage.php in core/
modules/ navigation/ src/ Plugin/ SectionStorage/ NavigationSectionStorage.php - OverridesSectionStorage.php in core/
modules/ layout_builder/ src/ Plugin/ SectionStorage/ OverridesSectionStorage.php - SectionStorageManager.php in core/
modules/ layout_builder/ src/ SectionStorage/ SectionStorageManager.php - SimpleConfigSectionStorage.php in core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ src/ Plugin/ SectionStorage/ SimpleConfigSectionStorage.php
File
-
core/
modules/ layout_builder/ src/ Attribute/ SectionStorage.php, line 16
Namespace
Drupal\layout_builder\AttributeView source
class SectionStorage extends Plugin {
/**
* Constructs a SectionStorage attribute.
*
* @param string $id
* The plugin ID.
* @param int $weight
* (optional) The plugin weight.
* When an entity with layout is rendered, section storage plugins are
* checked, in order of their weight, to determine which one should be used
* to render the layout.
* @param \Drupal\Component\Plugin\Context\ContextDefinitionInterface[] $context_definitions
* (optional) Any required context definitions.
* When an entity with layout is rendered, all section storage plugins which
* match a particular set of contexts are checked, in order of their weight,
* to determine which plugin should be used to render the layout.
* @see \Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface::findByContext()
* @param bool $handles_permission_check
* (optional) Indicates that this section storage handles its own
* permission checking. If FALSE, the 'configure any layout' permission
* will be required during routing access. If TRUE, Layout Builder will
* not enforce any access restrictions for the storage, so the section
* storage's implementation of access() must perform the access checking itself.
* @param string|null $deriver
* (optional) The deriver class.
*/
public function __construct(string $id, int $weight = 0, array $context_definitions = [], bool $handles_permission_check = FALSE, ?string $deriver = NULL) {
}
/**
* {@inheritdoc}
*/
public function get() : SectionStorageDefinition {
return new SectionStorageDefinition([
'id' => $this->id,
'class' => $this->class,
'weight' => $this->weight,
'context_definitions' => $this->context_definitions,
'handles_permission_check' => $this->handles_permission_check,
]);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
SectionStorage::get | public | function | |
SectionStorage::__construct | public | function | Constructs a SectionStorage attribute. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.