You are here

interface ImageReplaceStorageInterface in Image Replace 8

Defines the interface for image_replace storage implementations.

Hierarchy

Expanded class hierarchy of ImageReplaceStorageInterface

All classes that implement ImageReplaceStorageInterface

1 file declares its use of ImageReplaceStorageInterface
ImageReplaceEffect.php in src/Plugin/ImageEffect/ImageReplaceEffect.php

File

src/ImageReplaceStorageInterface.php, line 8

Namespace

Drupal\image_replace
View source
interface ImageReplaceStorageInterface {

  /**
   * Determine replacement image uri for the given original filename.
   *
   * @param string $target_style
   *   The target image style name.
   * @param string $target_uri
   *   The uri of the image for which to find a replacement.
   *
   * @return string|null
   *   The replacement uri when a mapping for the given uri/style combination
   *   exists.
   */
  public function get($target_style, $target_uri);

  /**
   * Add an image replacement mapping.
   *
   * @param string $target_style
   *   The target image style name.
   * @param string $target_uri
   *   The uri of the image for which to set a replacement.
   * @param string $replacement_uri
   *   The replacement uri to set for the given uri/style combination.
   */
  public function add($target_style, $target_uri, $replacement_uri);

  /**
   * Remove the given image replacement mapping if it exists.
   *
   * @param string $target_style
   *   The target image style name.
   * @param string $target_uri
   *   The uri of the image for which to remove the replacement.
   */
  public function remove($target_style, $target_uri);

}

Members

Namesort descending Modifiers Type Description Overrides
ImageReplaceStorageInterface::add public function Add an image replacement mapping. 1
ImageReplaceStorageInterface::get public function Determine replacement image uri for the given original filename. 1
ImageReplaceStorageInterface::remove public function Remove the given image replacement mapping if it exists. 1