You are here

interface SectionStorageManagerInterface in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/SectionStorage/SectionStorageManagerInterface.php \Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface
  2. 9 core/modules/layout_builder/src/SectionStorage/SectionStorageManagerInterface.php \Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface

Provides the interface for a plugin manager of section storage types.

Hierarchy

Expanded class hierarchy of SectionStorageManagerInterface

All classes that implement SectionStorageManagerInterface

11 files declare their use of SectionStorageManagerInterface
InlineBlockEntityOperations.php in core/modules/layout_builder/src/InlineBlockEntityOperations.php
LayoutBuilderIntegration.php in core/modules/quickedit/src/LayoutBuilderIntegration.php
LayoutBuilderLocalTaskDeriver.php in core/modules/layout_builder/src/Plugin/Derivative/LayoutBuilderLocalTaskDeriver.php
LayoutBuilderRoutes.php in core/modules/layout_builder/src/Routing/LayoutBuilderRoutes.php
LayoutBuilderRoutesTest.php in core/modules/layout_builder/tests/src/Unit/LayoutBuilderRoutesTest.php

... See full list

File

core/modules/layout_builder/src/SectionStorage/SectionStorageManagerInterface.php, line 11

Namespace

Drupal\layout_builder\SectionStorage
View source
interface SectionStorageManagerInterface extends DiscoveryInterface {

  /**
   * Loads a section storage with the provided contexts applied.
   *
   * @param string $type
   *   The section storage type.
   * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
   *   (optional) The contexts available for this storage to use.
   *
   * @return \Drupal\layout_builder\SectionStorageInterface|null
   *   The section storage or NULL if its context requirements are not met.
   */
  public function load($type, array $contexts = []);

  /**
   * Finds the section storage to load based on available contexts.
   *
   * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
   *   The contexts which should be used to determine which storage to return.
   * @param \Drupal\Core\Cache\RefinableCacheableDependencyInterface $cacheability
   *   Refinable cacheability object, which will be populated based on the
   *   cacheability of each section storage candidate. After calling this method
   *   this parameter will reflect the cacheability information used to
   *   determine the correct section storage. This must be associated with any
   *   output that uses the result of this method.
   *
   * @return \Drupal\layout_builder\SectionStorageInterface|null
   *   The section storage if one matched all contexts, or NULL otherwise.
   *
   * @see \Drupal\Core\Cache\RefinableCacheableDependencyInterface
   */
  public function findByContext(array $contexts, RefinableCacheableDependencyInterface $cacheability);

  /**
   * Loads a section storage with no associated section list.
   *
   * @param string $type
   *   The type of the section storage being instantiated.
   *
   * @return \Drupal\layout_builder\SectionStorageInterface
   *   The section storage.
   *
   * @internal
   *   Section storage relies on context to load section lists. Use ::load()
   *   when that context is available. This method is intended for use by
   *   collaborators of the plugins in build-time situations when section
   *   storage type must be consulted.
   */
  public function loadEmpty($type);

}

Members

Namesort descending Modifiers Type Description Overrides
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 4
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 3
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists. 1
SectionStorageManagerInterface::findByContext public function Finds the section storage to load based on available contexts. 1
SectionStorageManagerInterface::load public function Loads a section storage with the provided contexts applied. 1
SectionStorageManagerInterface::loadEmpty public function Loads a section storage with no associated section list. 1