Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / layout_builder / src / SectionStorage / SectionStorageManagerInterface.php
1 <?php
2
3 namespace Drupal\layout_builder\SectionStorage;
4
5 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
6
7 /**
8  * Provides the interface for a plugin manager of section storage types.
9  *
10  * @internal
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.
14  */
15 interface SectionStorageManagerInterface extends DiscoveryInterface {
16
17   /**
18    * Loads a section storage with no associated section list.
19    *
20    * @param string $id
21    *   The ID of the section storage being instantiated.
22    *
23    * @return \Drupal\layout_builder\SectionStorageInterface
24    *   The section storage.
25    */
26   public function loadEmpty($id);
27
28   /**
29    * Loads a section storage populated with an existing section list.
30    *
31    * @param string $type
32    *   The section storage type.
33    * @param string $id
34    *   The section list ID.
35    *
36    * @return \Drupal\layout_builder\SectionStorageInterface
37    *   The section storage.
38    *
39    * @throws \InvalidArgumentException
40    *   Thrown if the ID is invalid.
41    */
42   public function loadFromStorageId($type, $id);
43
44   /**
45    * Loads a section storage populated with a section list derived from a route.
46    *
47    * @param string $type
48    *   The section storage type.
49    * @param string $value
50    *   The raw value.
51    * @param mixed $definition
52    *   The parameter definition provided in the route options.
53    * @param string $name
54    *   The name of the parameter.
55    * @param array $defaults
56    *   The route defaults array.
57    *
58    * @return \Drupal\layout_builder\SectionStorageInterface|null
59    *   The section storage if it could be loaded, or NULL otherwise.
60    *
61    * @see \Drupal\Core\ParamConverter\ParamConverterInterface::convert()
62    */
63   public function loadFromRoute($type, $value, $definition, $name, array $defaults);
64
65 }