You are here

protected function ExportAllForm::loadFile in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_export/src/Form/ExportAllForm.php \Drupal\bibcite_export\Form\ExportAllForm::loadFile()

Load file by fid.

If file does not exist in the file system then delete him from database.

Parameters

int $fid: File ID.

Return value

\Drupal\Core\Entity\EntityInterface|bool File object or FALSE if file does not exist.

1 call to ExportAllForm::loadFile()
ExportAllForm::createFilesList in modules/bibcite_export/src/Form/ExportAllForm.php
Create files list based on info from temp storage.

File

modules/bibcite_export/src/Form/ExportAllForm.php, line 132

Class

ExportAllForm
Export all reference data to any available export format.

Namespace

Drupal\bibcite_export\Form

Code

protected function loadFile($fid) {
  if ($file = File::load($fid)) {
    if (file_exists($file
      ->getFileUri())) {
      return $file;
    }
    else {
      $file
        ->delete();
    }
  }
  return FALSE;
}