3 namespace Drupal\layout_builder\SectionStorage;
5 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
8 * Provides the interface for a plugin manager of section storage types.
11 * Layout Builder is currently experimental and should only be leveraged by
12 * experimental modules and development releases of contributed modules.
13 * See https://www.drupal.org/core/experimental for more information.
15 interface SectionStorageManagerInterface extends DiscoveryInterface {
18 * Loads a section storage with no associated section list.
21 * The ID of the section storage being instantiated.
23 * @return \Drupal\layout_builder\SectionStorageInterface
24 * The section storage.
26 public function loadEmpty($id);
29 * Loads a section storage populated with an existing section list.
32 * The section storage type.
34 * The section list ID.
36 * @return \Drupal\layout_builder\SectionStorageInterface
37 * The section storage.
39 * @throws \InvalidArgumentException
40 * Thrown if the ID is invalid.
42 public function loadFromStorageId($type, $id);
45 * Loads a section storage populated with a section list derived from a route.
48 * The section storage type.
49 * @param string $value
51 * @param mixed $definition
52 * The parameter definition provided in the route options.
54 * The name of the parameter.
55 * @param array $defaults
56 * The route defaults array.
58 * @return \Drupal\layout_builder\SectionStorageInterface|null
59 * The section storage if it could be loaded, or NULL otherwise.
61 * @see \Drupal\Core\ParamConverter\ParamConverterInterface::convert()
63 public function loadFromRoute($type, $value, $definition, $name, array $defaults);