You are here

function RealisticDummyContentFileGroup::Value in Realistic Dummy Content 7

Returns the value of the radical file if one exists.

Return value

NULL if a radical file does not exist, if it does not have contents, or if an error occurred. Otherwise returns the contents of the file.

File

api/includes/RealisticDummyContentFileGroup.inc, line 124
Define RealisticDummyContentFileGroup autoload class.

Class

RealisticDummyContentFileGroup
Represents files as groups.

Code

function Value() {
  try {
    $file = $this
      ->GetFile();
    if (isset($file->uri)) {
      return trim(RealisticDummyContentEnvironment::Get()
        ->file_get_contents($file->uri));
    }
    else {
      return NULL;
    }
  } catch (Exception $e) {
    return NULL;
  }
}