function MimeTypeMap::setMapping

Sets the underlying mapping array.

Deprecated

in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement for this method.

See also

https://www.drupal.org/node/3494040

File

core/lib/Drupal/Core/File/MimeType/MimeTypeMap.php, line 1011

Class

MimeTypeMap
Provides a sensible mapping between filename extensions and MIME types.

Namespace

Drupal\Core\File\MimeType

Code

public function setMapping(array $mapping) : void {
  // We do not trigger a deprecation error as this method is needed for
  // calling the deprecated hook_file_mimetype_mapping_alter() in
  // LegacyMimeTypeMapLoadedSubscriber::onMimeTypeMapLoaded().
  $this->mapping = $mapping;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.