You are here

protected function ExifTagMapper::stringToTag in File metadata manager 8.2

Same name and namespace in other branches
  1. 8 file_mdm_exif/src/ExifTagMapper.php \Drupal\file_mdm_exif\ExifTagMapper::stringToTag()

Returns the IFD/TAG integers for a TAG literal.

Parameters

string $value: A TAG literal.

Return value

array A simple array of with IFD and TAG, expressed as integers.

Throws

\Drupal\file_mdm\FileMetadataException When the IFD/TAG combination could not be found.

1 call to ExifTagMapper::stringToTag()
ExifTagMapper::resolveKeyToIfdAndTag in file_mdm_exif/src/ExifTagMapper.php
Resolves a metadata 'key' to the default EXIF IFD and TAG.

File

file_mdm_exif/src/ExifTagMapper.php, line 225

Class

ExifTagMapper
Provides a mapping service for EXIF ifds and tags.

Namespace

Drupal\file_mdm_exif

Code

protected function stringToTag($value) {
  $v = strtolower($value);
  $tag = isset($this
    ->getStringToTagMap()[$v]) ? $this
    ->getStringToTagMap()[$v] : NULL;
  if ($tag) {
    return $tag;
  }
  throw new FileMetadataException("No EXIF TAG found for key '{$value}'", "EXIF");
}