You are here

public function FileEntity::getMimeTypeType in File Entity (fieldable files) 8.2

Returns the first part of the mimetype of the file.

Return value

string The mimetype.

3 calls to FileEntity::getMimeTypeType()
FileEntity::fetchImageDimensions in src/Entity/FileEntity.php
Fetch the dimensions of an image and store them in the file metadata array.
FileEntity::postSave in src/Entity/FileEntity.php
Implements hook_file_insert().
FileEntity::updateImageFieldDimensions in src/Entity/FileEntity.php
Updates the image dimensions stored in any image fields for a file.

File

src/Entity/FileEntity.php, line 191

Class

FileEntity
Replace for the core file entity class.

Namespace

Drupal\file_entity\Entity

Code

public function getMimeTypeType() {
  list($type, $subtype) = explode('/', $this
    ->getMimeType(), 2);
  return $type;
}