public function SectionStorageManager::load in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/src/SectionStorage/SectionStorageManager.php \Drupal\layout_builder\SectionStorage\SectionStorageManager::load()
- 10 core/modules/layout_builder/src/SectionStorage/SectionStorageManager.php \Drupal\layout_builder\SectionStorage\SectionStorageManager::load()
Loads a section storage with the provided contexts applied.
Parameters
string $type: The section storage type.
\Drupal\Component\Plugin\Context\ContextInterface[] $contexts: (optional) The contexts available for this storage to use.
Return value
\Drupal\layout_builder\SectionStorageInterface|null The section storage or NULL if its context requirements are not met.
Overrides SectionStorageManagerInterface::load
3 calls to SectionStorageManager::load()
- SectionStorageManager::findByContext in core/
modules/ layout_builder/ src/ SectionStorage/ SectionStorageManager.php - Finds the section storage to load based on available contexts.
- SectionStorageManager::loadFromRoute in core/
modules/ layout_builder/ src/ SectionStorage/ SectionStorageManager.php - Loads a section storage populated with a section list derived from a route.
- SectionStorageManager::loadFromStorageId in core/
modules/ layout_builder/ src/ SectionStorage/ SectionStorageManager.php - Loads a section storage populated with an existing section list.
File
- core/
modules/ layout_builder/ src/ SectionStorage/ SectionStorageManager.php, line 77
Class
- SectionStorageManager
- Provides the Section Storage type plugin manager.
Namespace
Drupal\layout_builder\SectionStorageCode
public function load($type, array $contexts = []) {
$plugin = $this
->loadEmpty($type);
try {
$this->contextHandler
->applyContextMapping($plugin, $contexts);
} catch (ContextException $e) {
return NULL;
}
return $plugin;
}