You are here

function ExifCustomHelper::getFileByFilename in EXIF Custom 7

Get a file from the database based on its filename.

Taken from file_entity.test.

Parameters

$filename: A file filename, usually generated by $this->randomName().

$reset: (optional) Whether to reset the internal file_load() cache.

Return value

A file object matching $filename.

1 call to ExifCustomHelper::getFileByFilename()
ExifCustomTestCase::testProcess in tests/ExifCustomTestCase.test
Run through the module's normal functionality.

File

tests/ExifCustomHelper.test, line 72
Base test logic for the EXIF Custom module.

Class

ExifCustomHelper
Base test logic for the EXIF Custom module.

Code

function getFileByFilename($filename, $reset = FALSE) {
  $files = file_load_multiple(array(), array(
    'filename' => $filename,
  ), $reset);

  // Load the first file returned from the database.
  $returned_file = reset($files);
  return $returned_file;
}