You are here

public function SectionStorageManagerInterface::findByContext in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/SectionStorage/SectionStorageManagerInterface.php \Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface::findByContext()

Finds the section storage to load based on available contexts.

Parameters

\Drupal\Component\Plugin\Context\ContextInterface[] $contexts: The contexts which should be used to determine which storage to return.

\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 value

\Drupal\layout_builder\SectionStorageInterface|null The section storage if one matched all contexts, or NULL otherwise.

See also

\Drupal\Core\Cache\RefinableCacheableDependencyInterface

1 method overrides SectionStorageManagerInterface::findByContext()
SectionStorageManager::findByContext in core/modules/layout_builder/src/SectionStorage/SectionStorageManager.php
Finds the section storage to load based on available contexts.

File

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

Class

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

Namespace

Drupal\layout_builder\SectionStorage

Code

public function findByContext(array $contexts, RefinableCacheableDependencyInterface $cacheability);