You are here

public function DestinationBase::loadFileMetadata in Backup and Migrate 5.0.x

Load the metadata for the given file however it may be stored.

Parameters

\Drupal\backup_migrate\Core\File\BackupFileInterface $file:

Return value

\Drupal\backup_migrate\Core\File\BackupFileInterface

Overrides ReadableDestinationInterface::loadFileMetadata

2 calls to DestinationBase::loadFileMetadata()
DirectoryDestination::queryFiles in src/Core/Destination/DirectoryDestination.php
Run a basic query with sort on the list of files.
DrupalDirectoryDestination::queryFiles in src/Drupal/Destination/DrupalDirectoryDestination.php
Run a basic query with sort on the list of files.

File

src/Core/Destination/DestinationBase.php, line 37

Class

DestinationBase
@package Drupal\backup_migrate\Core\Destination

Namespace

Drupal\backup_migrate\Core\Destination

Code

public function loadFileMetadata(BackupFileInterface $file) {

  // If this file is already loaded, simply return it.
  // @todo Fix this inappropriate use of file metadata.
  if (!$file
    ->getMeta('metadata_loaded')) {
    $metadata = $this
      ->loadFileMetadataArray($file);
    $file
      ->setMetaMultiple($metadata);
    $file
      ->setMeta('metadata_loaded', TRUE);
  }
  return $file;
}