comparison core/modules/image/src/ImageStyleStorage.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php
2
3 namespace Drupal\image;
4
5 use Drupal\Core\Config\Entity\ConfigEntityStorage;
6
7 /**
8 * Storage controller class for "image style" configuration entities.
9 */
10 class ImageStyleStorage extends ConfigEntityStorage implements ImageStyleStorageInterface {
11
12 /**
13 * Image style replacement memory storage.
14 *
15 * This value is not stored in the backend. It's used during the deletion of
16 * an image style to save the replacement image style in the same request. The
17 * value is used later, when resolving dependencies.
18 *
19 * @var string[]
20 *
21 * @see \Drupal\image\Form\ImageStyleDeleteForm::submitForm()
22 */
23 protected $replacement = [];
24
25 /**
26 * {@inheritdoc}
27 */
28 public function setReplacementId($name, $replacement) {
29 $this->replacement[$name] = $replacement;
30 }
31
32 /**
33 * {@inheritdoc}
34 */
35 public function getReplacementId($name) {
36 return isset($this->replacement[$name]) ? $this->replacement[$name] : NULL;
37 }
38
39 /**
40 * {@inheritdoc}
41 */
42 public function clearReplacementId($name) {
43 unset($this->replacement[$name]);
44 }
45
46 }