3 namespace Drupal\layout_builder;
6 * Provides an interface for loading layouts from tempstore.
9 * Layout Builder is currently experimental and should only be leveraged by
10 * experimental modules and development releases of contributed modules.
11 * See https://www.drupal.org/core/experimental for more information.
13 interface LayoutTempstoreRepositoryInterface {
16 * Gets the tempstore version of a section storage, if it exists.
18 * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
19 * The section storage to check for in tempstore.
21 * @return \Drupal\layout_builder\SectionStorageInterface
22 * Either the version of this section storage from tempstore, or the passed
23 * section storage if none exists.
25 * @throw \UnexpectedValueException
26 * Thrown if a value exists, but is not a section storage.
28 public function get(SectionStorageInterface $section_storage);
31 * Stores this section storage in tempstore.
33 * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
34 * The section storage to set in tempstore.
36 public function set(SectionStorageInterface $section_storage);
39 * Removes the tempstore version of a section storage.
41 * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
42 * The section storage to remove from tempstore.
44 public function delete(SectionStorageInterface $section_storage);