public function MimeMapManager::getMapClass in Sophron 8
Gets the FQCN of map currently in use by the manager.
Return value
string A FQCN.
Overrides MimeMapManagerInterface::getMapClass
2 calls to MimeMapManager::getMapClass()
- MimeMapManager::getExtension in src/
MimeMapManager.php - Gets a file extension.
- MimeMapManager::getType in src/
MimeMapManager.php - Gets a MIME type.
File
- src/
MimeMapManager.php, line 101
Class
- MimeMapManager
- Provides a sensible mapping between filename extensions and MIME types.
Namespace
Drupal\sophronCode
public function getMapClass() {
if (!$this->currentMapClass) {
switch ($this->sophronSettings
->get('map_option')) {
case static::DRUPAL_MAP:
$this
->setMapClass(DrupalMap::class);
break;
case static::DEFAULT_MAP:
$this
->setMapClass(DefaultMap::class);
break;
case static::CUSTOM_MAP:
$map_class = $this->sophronSettings
->get('map_class');
$this
->setMapClass($this
->isMapClassValid($map_class) ? $map_class : DrupalMap::class);
break;
}
}
return $this->currentMapClass;
}