You are here

public function SectionStorageManager::loadFromRoute in Drupal 8

Loads a section storage populated with a section list derived from a route.

Parameters

string $type: The section storage type.

string $value: The raw value.

mixed $definition: The parameter definition provided in the route options.

string $name: The name of the parameter.

array $defaults: The route defaults array.

Return value

\Drupal\layout_builder\SectionStorageInterface|null The section storage if it could be loaded, or NULL otherwise.

Overrides SectionStorageManagerInterface::loadFromRoute

See also

\Drupal\Core\ParamConverter\ParamConverterInterface::convert()

File

core/modules/layout_builder/src/SectionStorage/SectionStorageManager.php, line 126

Class

SectionStorageManager
Provides the Section Storage type plugin manager.

Namespace

Drupal\layout_builder\SectionStorage

Code

public function loadFromRoute($type, $value, $definition, $name, array $defaults) {
  @trigger_error('\\Drupal\\layout_builder\\SectionStorage\\SectionStorageManagerInterface::loadFromRoute() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. \\Drupal\\layout_builder\\SectionStorageInterface::deriveContextsFromRoute() and \\Drupal\\layout_builder\\SectionStorage\\SectionStorageManagerInterface::load() should be used instead. See https://www.drupal.org/node/3012353.', E_USER_DEPRECATED);
  $contexts = $this
    ->loadEmpty($type)
    ->deriveContextsFromRoute($value, $definition, $name, $defaults);
  return $this
    ->load($type, $contexts);
}