class SectionStorage

Same name in this branch
  1. 10 core/modules/layout_builder/src/Attribute/SectionStorage.php \Drupal\layout_builder\Attribute\SectionStorage
Same name in other branches
  1. 9 core/modules/layout_builder/src/Annotation/SectionStorage.php \Drupal\layout_builder\Annotation\SectionStorage
  2. 8.9.x core/modules/layout_builder/src/Annotation/SectionStorage.php \Drupal\layout_builder\Annotation\SectionStorage
  3. 11.x core/modules/layout_builder/src/Annotation/SectionStorage.php \Drupal\layout_builder\Annotation\SectionStorage
  4. 11.x core/modules/layout_builder/src/Attribute/SectionStorage.php \Drupal\layout_builder\Attribute\SectionStorage

Defines a Section Storage type annotation object.

Hierarchy

Expanded class hierarchy of SectionStorage

See also

\Drupal\layout_builder\SectionStorage\SectionStorageManager

Plugin API

Related topics

File

core/modules/layout_builder/src/Annotation/SectionStorage.php, line 16

Namespace

Drupal\layout_builder\Annotation
View source
class SectionStorage extends Plugin {
    
    /**
     * The plugin ID.
     *
     * @var string
     */
    public $id;
    
    /**
     * The plugin weight, optional (defaults to 0).
     *
     * 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.
     *
     * @var int
     */
    public $weight = 0;
    
    /**
     * Any required context definitions, optional.
     *
     * 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.
     *
     * @var array
     *
     * @see \Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface::findByContext()
     */
    public $context_definitions = [];
    
    /**
     * 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. Defaults to FALSE.
     *
     * @var bool
     *
     * @see \Drupal\layout_builder\Access\LayoutBuilderAccessCheck
     */
    public $handles_permission_check = FALSE;
    
    /**
     * {@inheritdoc}
     */
    public function get() {
        return new SectionStorageDefinition($this->definition);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::getClass public function Overrides AnnotationInterface::getClass 1
Plugin::getId public function Overrides AnnotationInterface::getId
Plugin::getProvider public function Overrides AnnotationInterface::getProvider 1
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Overrides AnnotationInterface::setClass 1
Plugin::setProvider public function Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 3
SectionStorage::$context_definitions public property Any required context definitions, optional.
SectionStorage::$handles_permission_check public property Indicates that this section storage handles its own permission checking.
SectionStorage::$id public property The plugin ID.
SectionStorage::$weight public property The plugin weight, optional (defaults to 0).
SectionStorage::get public function Overrides Plugin::get

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