Version 1
[yaffs-website] / web / core / modules / image / src / ImageStyleStorageInterface.php
1 <?php
2
3 namespace Drupal\image;
4
5 /**
6  * Interface for storage controller for "image style" configuration entities.
7  */
8 interface ImageStyleStorageInterface {
9
10   /**
11    * Stores a replacement ID for an image style being deleted.
12    *
13    * The method stores a replacement style to be used by the configuration
14    * dependency system when a image style is deleted. The replacement style is
15    * replacing the deleted style in other configuration entities that are
16    * depending on the image style being deleted.
17    *
18    * @param string $name
19    *   The ID of the image style to be deleted.
20    * @param string $replacement
21    *   The ID of the image style used as replacement.
22    */
23   public function setReplacementId($name, $replacement);
24
25   /**
26    * Retrieves the replacement ID of a deleted image style.
27    *
28    * The method is retrieving the value stored by ::setReplacementId().
29    *
30    * @param string $name
31    *   The ID of the image style to be replaced.
32    *
33    * @return string|null
34    *   The ID of the image style used as replacement, if there's any, or NULL.
35    *
36    * @see \Drupal\image\ImageStyleStorageInterface::setReplacementId()
37    */
38   public function getReplacementId($name);
39
40   /**
41    * Clears a replacement ID from the storage.
42    *
43    * The method clears the value previously stored with ::setReplacementId().
44    *
45    * @param string $name
46    *   The ID of the image style to be replaced.
47    *
48    * @see \Drupal\image\ImageStyleStorageInterface::setReplacementId()
49    */
50   public function clearReplacementId($name);
51
52 }