Pull merge.
[yaffs-website] / web / core / modules / layout_builder / src / LayoutTempstoreRepositoryInterface.php
1 <?php
2
3 namespace Drupal\layout_builder;
4
5 /**
6  * Provides an interface for loading layouts from tempstore.
7  *
8  * @internal
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.
12  */
13 interface LayoutTempstoreRepositoryInterface {
14
15   /**
16    * Gets the tempstore version of a section storage, if it exists.
17    *
18    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
19    *   The section storage to check for in tempstore.
20    *
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.
24    *
25    * @throw \UnexpectedValueException
26    *   Thrown if a value exists, but is not a section storage.
27    */
28   public function get(SectionStorageInterface $section_storage);
29
30   /**
31    * Stores this section storage in tempstore.
32    *
33    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
34    *   The section storage to set in tempstore.
35    */
36   public function set(SectionStorageInterface $section_storage);
37
38   /**
39    * Checks for the existence of a tempstore version of a section storage.
40    *
41    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
42    *   The section storage to check for in tempstore.
43    *
44    * @return bool
45    *   TRUE if there is a tempstore version of this section storage.
46    */
47   public function has(SectionStorageInterface $section_storage);
48
49   /**
50    * Removes the tempstore version of a section storage.
51    *
52    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
53    *   The section storage to remove from tempstore.
54    */
55   public function delete(SectionStorageInterface $section_storage);
56
57 }