You are here

ImageZoomOptions.php in Image Zoom 8.3

File

src/Entity/ImageZoomOptions.php
View source
<?php

namespace Drupal\imagezoom\Entity;

use Drupal\Core\Config\Entity\ConfigEntityBase;

/**
 * Defines the Image Zoom options profile entity type.
 *
 * @ConfigEntityType(
 *   id = "imagezoom",
 *   label = @Translation("Image Zoom options"),
 *   label_collection = @Translation("Image Zoom options"),
 *   label_singular = @Translation("options profile"),
 *   label_plural = @Translation("options profiles"),
 *   label_count = @PluralTranslation(
 *     singular = "@count options profile",
 *     plural = "@count options profiles"
 *   ),
 *   handlers = {
 *     "list_builder" = "Drupal\imagezoom\ImageZoomOptionsListBuilder",
 *     "form" = {
 *       "add" = "Drupal\imagezoom\Form\ImageZoomOptionsForm",
 *       "edit" = "Drupal\imagezoom\Form\ImageZoomOptionsForm",
 *       "delete" = "Drupal\imagezoom\Form\ImageZoomOptionsDeleteForm"
 *     },
 *     "route_provider" = {
 *       "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
 *     },
 *   },
 *   config_prefix = "options",
 *   admin_permission = "administer imagezoom",
 *   entity_keys = {
 *     "id" = "id",
 *     "label" = "label",
 *     "uuid" = "uuid"
 *   },
 *   links = {
 *     "canonical" = "/admin/config/media/imagezoom/{imagezoom}",
 *     "add-form" = "/admin/config/media/imagezoom/add",
 *     "edit-form" = "/admin/config/media/imagezoom/{imagezoom}/edit",
 *     "delete-form" = "/admin/config/media/imagezoom/{imagezoom}/delete",
 *     "collection" = "/admin/config/media/imagezoom"
 *   },
 *   config_export = {
 *     "id",
 *     "label",
 *     "options",
 *   }
 * )
 */
class ImageZoomOptions extends ConfigEntityBase implements ImageZoomOptionsInterface {

  /**
   * The Image Zoom options profile ID.
   *
   * @var string
   */
  protected $id;

  /**
   * The Image Zoom options profile label.
   *
   * @var string
   */
  protected $label;

  /**
   * The option values.
   *
   * @var array
   */
  protected $options = [];

  /**
   * {@inheritdoc}
   */
  public function getOptions() {
    return $this->options;
  }

  /**
   * {@inheritdoc}
   */
  public function setOptions(array $options) {
    $this->options = $options;
  }

  /**
   * {@inheritdoc}
   */
  public function getOption($name) {
    return isset($this->options[$name]) ? $this->options[$name] : NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function setOption($name, $value) {
    $this->options[$name] = $value;
  }

}

Classes

Namesort descending Description
ImageZoomOptions Defines the Image Zoom options profile entity type.