You are here

public function DirectoryDestination::getFile in Backup and Migrate 5.0.x

Get a file object representing the file with the given ID from the dest.

This file item will not necessarily be readable nor will it have extended metadata loaded. Use loadForReading and loadFileMetadata to get those.

@todo Decide if extended metadata should ALWAYS be loaded here.

Parameters

string $id: The unique identifier for the file. Usually the filename.

Return value

\Drupal\backup_migrate\Core\File\BackupFileInterface The file if it exists or NULL if it doesn't

Overrides ReadableDestinationInterface::getFile

1 call to DirectoryDestination::getFile()
DirectoryDestination::deleteTheFile in src/Core/Destination/DirectoryDestination.php
Do the actual delete for a file.

File

src/Core/Destination/DirectoryDestination.php, line 104

Class

DirectoryDestination
@package Drupal\backup_migrate\Core\Destination

Namespace

Drupal\backup_migrate\Core\Destination

Code

public function getFile($id) {
  if ($this
    ->fileExists($id)) {
    $out = new BackupFile();
    $out
      ->setMeta('id', $id);
    $out
      ->setFullName($id);
    return $out;
  }
  return NULL;
}