You are here

function FileGroup::GetRadicalExtension in Realistic Dummy Content 8

Returns the extension of the radical filename.

Return value

An extension, can be empty.

File

api/src/environments/FileGroup.php, line 178
Define autoload class.

Class

FileGroup
Represents files as groups.

Namespace

Drupal\realistic_dummy_content_api\environments

Code

function GetRadicalExtension() {
  $filename = $this
    ->GetRadical();
  $extension = pathinfo($filename, PATHINFO_EXTENSION);
  if (!$extension) {
    throw new Exception('Files require extensions.');
  }
  return $extension;
}