You are here

function Type::fileType in File Entity (fieldable files) 8.2

Helper function to return the human-readable type of the file.

2 calls to Type::fileType()
Type::summaryName in src/Plugin/views/argument/Type.php
Provides the name to use for the summary. By default this is just the name field.
Type::title in src/Plugin/views/argument/Type.php
Get the title this argument will assign the view, given the argument.

File

src/Plugin/views/argument/Type.php, line 32

Class

Type
Argument handler to accept a file type.

Namespace

Drupal\file_entity\Plugin\views\argument

Code

function fileType($type) {
  if ($file_entity = FileType::load($type)) {
    return $file_entity
      ->label();
  }
  else {
    return t('Undefined');
  }
}