You are here

public function Mimetypes::get in File Entity (fieldable files) 8.2

Get MIME types.

Return value

array An associative array of MIME types, keyed by extensions.

File

src/Mimetypes.php, line 20

Class

Mimetypes
Overrides a MIME type guesser to provide a public list of MIME types.

Namespace

Drupal\file_entity

Code

public function get() {
  if ($this->mapping === NULL) {
    $mapping = $this->defaultMapping;

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