You are here

public function ImageReplaceDatabaseStorage::remove in Image Replace 8

Remove the given image replacement mapping if it exists.

Parameters

string $target_style: The target image style name.

string $target_uri: The uri of the image for which to remove the replacement.

Overrides ImageReplaceStorageInterface::remove

File

src/ImageReplaceDatabaseStorage.php, line 59

Class

ImageReplaceDatabaseStorage
Defines a class for image_replace database storage operations.

Namespace

Drupal\image_replace

Code

public function remove($target_style, $target_uri) {
  $target_uri_hash = hash('sha256', $target_uri);
  return $this->database
    ->delete('image_replace')
    ->condition('target_style', $target_style)
    ->condition('target_uri_hash', $target_uri_hash)
    ->execute();
}