You are here

private function ExtensionMimeTypeGuesser::checkDefaultMapping in FileField Sources 8

Check for default mapping.

2 calls to ExtensionMimeTypeGuesser::checkDefaultMapping()
ExtensionMimeTypeGuesser::convertMimeTypeToExtension in src/File/MimeType/ExtensionMimeTypeGuesser.php
Convert mime type to extension.
ExtensionMimeTypeGuesser::convertMimeTypeToMostCommonExtension in src/File/MimeType/ExtensionMimeTypeGuesser.php
Convert mime type to most common extension.

File

src/File/MimeType/ExtensionMimeTypeGuesser.php, line 61

Class

ExtensionMimeTypeGuesser
Add methods to core guesser.

Namespace

Drupal\filefield_sources\File\MimeType

Code

private function checkDefaultMapping() {
  if ($this->mapping === NULL) {
    $mapping = $this->defaultMapping;

    // Allow modules to alter the default mapping.
    $this->moduleHandler
      ->alter('file_mimetype_mapping', $mapping);
    $this->mapping = $mapping;
  }
}