Adds a new mime type to the map and its associated extensions

@param string $sMime       The mime type to add
@param array  $aExtensions An array of acceptable extensions

@return Mime
974359
public function addMime(string $sMime, array $aExtensions): self
    {
        $this->updateMap(static::$aMapMimeToExtensions, $sMime, $aExtensions);
        foreach ($aExtensions as $sExtension) {
            $this->updateMap(static::$aMapExtensionToMimes, $sExtension, [$sMime]);
        }
        return $this;
    }
1107182
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = AppendContentStreamResponse.class)
	public JAXBElement<CmisExtensionType> createAppendContentStreamResponseExtension(
			CmisExtensionType value) {
		return new JAXBElement<CmisExtensionType>(
				_GetPropertiesExtension_QNAME, CmisExtensionType.class,
				AppendContentStreamResponse.class, value);
	}
1036452
public function setMime($mime)
    {
        if (!empty($mime)) {
            $this->setContentType(
                Mime::getFullMime($mime)
            );
        }

        return $this;
    }
594753
public function setExtension($sExtension = null)
    {
        if (null === $sExtension) {
            return $this;
        }

        if (!in_array($sExtension, $this->aValidExtensions)) {
            $message = sprintf(
                'The extension "%s" is not a valid one, extension image for Gravatar can be: %s',
                $sExtension,
                implode(', ', $this->aValidExtensions)
            );

            throw new InvalidImageExtensionException($message);
        }

        $this->sExtension = $sExtension;

        return $this;
    }
1238143
public void addMimeMapping(final WebAppMimeMapping mimeMapping) {
		NullArgumentException.validateNotNull(mimeMapping, "Mime mapping");
		NullArgumentException.validateNotNull(mimeMapping.getExtension(),
				"Mime mapping extension");
		NullArgumentException.validateNotNull(mimeMapping.getMimeType(),
				"Mime mapping type");
		mimeMappings.add(mimeMapping);
	}
252114
public function addAttachment($filename, $data, $mime = null)
    {
        $data = file_get_contents($data);
        $this->attachments[] = array($filename, $data, $mime);
        return $this;
    }
483083
public function setExtensions(array $extensions)
    {
        foreach ($extensions as $extension) {
            $this->checkType(CmisExtensionElementInterface::class, $extension);
        }

        $this->extensions = $extensions;
    }
228077
private function imageTypeToMimeType($imageExtension)
    {
        $this->validateImageExtension($imageExtension);
        $imageTypeEnum = $this->imageTypeMap[$imageExtension];

        return image_type_to_mime_type($imageTypeEnum);
    }
1214285
public function mime($mime)
    {
        if (empty($mime)) return $this;
        $this->content_type = $this->expected_type = Mime::getFullMime($mime);
        if ($this->isUpload()) {
            $this->neverSerializePayload();
        }
        return $this;
    }
677163
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = GetACL.class)
	public JAXBElement<CmisExtensionType> createGetACLExtension(
			CmisExtensionType value) {
		return new JAXBElement<CmisExtensionType>(
				_GetPropertiesExtension_QNAME, CmisExtensionType.class,
				GetACL.class, value);
	}
596338
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = CreateDocument.class)
	public JAXBElement<CmisExtensionType> createCreateDocumentExtension(
			CmisExtensionType value) {
		return new JAXBElement<CmisExtensionType>(
				_GetPropertiesExtension_QNAME, CmisExtensionType.class,
				CreateDocument.class, value);
	}
241916
private static void addMimeToCompressedWithExtension(String extension) {
        String mime = EXTENSIONS.get(extension);
        if (mime != null && !COMPRESSED_MIME.contains(mime)) {
            COMPRESSED_MIME.add(mime);
        }
    }
249619
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = AppendContentStream.class)
	public JAXBElement<CmisExtensionType> createAppendContentStreamExtension(
			CmisExtensionType value) {
		return new JAXBElement<CmisExtensionType>(
				_GetPropertiesExtension_QNAME, CmisExtensionType.class,
				AppendContentStream.class, value);
	}
501722
public function addMimeTypeToExtension($mime_type, $extension)
    {
        if (is_array($extension)) {
            $this->mime_type_to_extensions[$mime_type] = $extension;
        } else {
            $this->mime_type_to_extensions[$mime_type] = array($extension);
        }

        return true;
    }
111571
public function setContentType($mimeType, $charset = null)
    {
        static $mimes = [];

        if (empty($mimes)) {
            $mimes = require(str_replace('Http', 'Config', __DIR__) . DIRECTORY_SEPARATOR . 'Mimes.php');
        }

        if (strpos($mimeType, '/') === false) {
            $extension = ltrim($mimeType, '.');
            // Is this extension supported?
            if (isset($mimes[ $extension ])) {
                $mimeType =& $mimes[ $extension ];
                if (is_array($mimeType)) {
                    $mimeType = current($mimeType);
                }
            }
        }

        $this->mimeType = $mimeType;

        $this->addHeader(
            'Content-Type',
            $mimeType
            . (empty($charset) ? '' : '; charset=' . $charset)
        );

        return $this;
    }
987281
public static function addExtension($extension, $mimeType, $namespace = null)
    {
        if (isset(self::$mimeTypes[$extension])) {
            if (is_array(self::$mimeTypes[$extension])) {
                if (!$namespace) {
                    throw new \BadMethodCallException(sprintf(
                        "Extension '%s' already exists, must define a namespace",
                        $extension
                    ));
                }
                self::$mimeTypes[$extension][$namespace] = $mimeType;
            }
        } else {
            if ($namespace) {
                self::$mimeTypes[$extension] = [
                    $namespace => $mimeType
                ];
            } else {
                self::$mimeTypes[$extension] = $mimeType;
            }
        }
    }
773603
public function getModuleExtensions($sModuleId)
    {
        if (!isset($this->_aModuleExtensions)) {
            $aModuleExtension = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesWithExtendedClass();
            $oModule = $this->getModule();
            $aExtension = [];
            foreach ($aModuleExtension as $sOxClass => $aFiles) {
                foreach ($aFiles as $sFilePath) {
                    $sId = $oModule->getIdByPath($sFilePath);
                    $aExtension[$sId][$sOxClass][] = $sFilePath;
                }
            }

            $this->_aModuleExtensions = $aExtension;
        }

        return $this->_aModuleExtensions[$sModuleId] ? $this->_aModuleExtensions[$sModuleId] : [];
    }