class MimeTypeMapFactory
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/File/MimeType/MimeTypeMapFactory.php \Drupal\Core\File\MimeType\MimeTypeMapFactory
Factory for creating the MIME type map.
Hierarchy
- class \Drupal\Core\File\MimeType\MimeTypeMapFactory
Expanded class hierarchy of MimeTypeMapFactory
File
-
core/
lib/ Drupal/ Core/ File/ MimeType/ MimeTypeMapFactory.php, line 13
Namespace
Drupal\Core\File\MimeTypeView source
class MimeTypeMapFactory {
public function __construct(protected readonly EventDispatcherInterface $eventDispatcher) {
}
/**
* Creates an instance of the MIME type map and dispatches the load event.
*
* @return \Drupal\Core\File\MimeType\MimeTypeMapInterface
* The MIME type map.
*/
public function create() : MimeTypeMapInterface {
$map = $this->doCreateMap();
$this->eventDispatcher
->dispatch(new MimeTypeMapLoadedEvent($map));
return $map;
}
/**
* Creates an instance of the MIME type map.
*
* @return \Drupal\Core\File\MimeType\MimeTypeMapInterface
* The MIME type map.
*/
protected function doCreateMap() : MimeTypeMapInterface {
return new MimeTypeMap();
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| MimeTypeMapFactory::create | public | function | Creates an instance of the MIME type map and dispatches the load event. |
| MimeTypeMapFactory::doCreateMap | protected | function | Creates an instance of the MIME type map. |
| MimeTypeMapFactory::__construct | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.