You are here

public function MediaTypeManager::getMediaTypeIdsByFileExtension in Media Bulk Upload 8

Throws

\Exception

Overrides MediaTypeManagerInterface::getMediaTypeIdsByFileExtension

File

src/MediaTypeManager.php, line 129

Class

MediaTypeManager
Class MediaTypeManager

Namespace

Drupal\media_bulk_upload

Code

public function getMediaTypeIdsByFileExtension($extension) {
  if (!isset($this->mediaTypeExtensions[$extension])) {
    throw new \Exception('No matching media type id for the given file.');
  }
  return $this->mediaTypeExtensions[$extension];
}