ImageStyle.php 1.24 KB
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Contains \Drupal\image\Plugin\Core\Entity\ImageStyle.
6 7
 */

8
namespace Drupal\image\Plugin\Core\Entity;
9 10

use Drupal\Core\Config\Entity\ConfigEntityBase;
11
use Drupal\Core\Entity\Annotation\EntityType;
12
use Drupal\Core\Annotation\Translation;
13 14 15

/**
 * Defines an image style configuration entity.
16
 *
17
 * @EntityType(
18 19 20
 *   id = "image_style",
 *   label = @Translation("Image style"),
 *   module = "image",
21 22 23
 *   controllers = {
 *     "storage" = "Drupal\image\ImageStyleStorageController"
 *   },
24
 *   uri_callback = "image_style_entity_uri",
25 26 27 28 29 30 31
 *   config_prefix = "image.style",
 *   entity_keys = {
 *     "id" = "name",
 *     "label" = "label",
 *     "uuid" = "uuid"
 *   }
 * )
32 33 34
 */
class ImageStyle extends ConfigEntityBase {

35 36 37 38 39 40 41
  /**
   * The name of the image style to use as replacement upon delete.
   *
   * @var string
   */
  protected $replacementID;

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
  /**
   * The name of the image style.
   *
   * @var string
   */
  public $name;

  /**
   * The image style label.
   *
   * @var string
   */
  public $label;

  /**
   * The array of image effects for this image style.
   *
   * @var string
   */
  public $effects;

  /**
   * Overrides Drupal\Core\Entity\Entity::id().
   */
  public function id() {
    return $this->name;
  }

}