You are here

interface BackupFileInterface in Backup and Migrate 8.4

Provides a metadata-only file object.

If the file needs to be readable or writable use \BackupMigrate\Core\File\BackupFileReadableInterface or \BackupMigrate\Core\File\BackupFileWritableInterface.

Hierarchy

Expanded class hierarchy of BackupFileInterface

All classes that implement BackupFileInterface

9 files declare their use of BackupFileInterface
BackupFile.php in lib/backup_migrate_core/src/File/BackupFile.php
DestinationBase.php in lib/backup_migrate_core/src/Destination/DestinationBase.php
DirectoryDestination.php in lib/backup_migrate_core/src/Destination/DirectoryDestination.php
DrupalBrowserUploadDestination.php in src/Destination/DrupalBrowserUploadDestination.php
ListableDestinationInterface.php in lib/backup_migrate_core/src/Destination/ListableDestinationInterface.php

... See full list

File

lib/backup_migrate_core/src/File/BackupFileInterface.php, line 12

Namespace

BackupMigrate\Core\File
View source
interface BackupFileInterface {

  /**
   * Get a metadata value.
   *
   * @param string $key The key for the metadata item.
   *
   * @return mixed The value of the metadata for this file.
   */
  public function getMeta($key);

  /**
   * Set a metadata value.
   *
   * @param string $key The key for the metadata item.
   * @param mixed $value The value for the metadata item.
   */
  public function setMeta($key, $value);

  /**
   * Set a metadata value.
   *
   * @param array $values An array of key-value pairs for the file metadata.
   */
  public function setMetaMultiple($values);

  /**
   * Get all meta data as an array.
   *
   * @return array $values An array of key-value pairs for the file metadata.
   */
  public function getMetaAll();

  /**
   * Set the file name without extension.
   *
   * @param string $name
   */
  public function setName($name);

  /**
   * Get the file name without extension.
   *
   * @return string
   */
  public function getName();

  /**
   * Get the full filename with extensions.
   *
   * @return string
   *  The full filename (with extension, without filepath)
   */
  public function getFullName();

  /**
   * Set the full filename with extensions.
   *
   * @param string $fullname
   *  The full filename (with extension, without filepath)
   */
  public function setFullName($fullname);

  /**
   * Get an array of file extensions.
   *
   * For example: testfile.txt.gz would return: ['txt', 'gz']
   *
   * @return array
   */
  public function getExtList();

  /**
   * Get the last file extension.
   *
   * For example: testfile.txt.gz would return: 'gz'
   *
   * @return mixed
   */
  public function getExtLast();

  /**
   * Get the full file extension.
   *
   * For example: testfile.txt.gz would return: 'txt.gz'
   *
   * @return mixed
   */
  public function getExt();

  /**
   * Set the extension array for the file to the given array.
   *
   * @param array $ext
   *  The list of file extensions for the file
   */
  public function setExtList($ext);

}

Members

Namesort descending Modifiers Type Description Overrides
BackupFileInterface::getExt public function Get the full file extension. 1
BackupFileInterface::getExtLast public function Get the last file extension. 1
BackupFileInterface::getExtList public function Get an array of file extensions. 1
BackupFileInterface::getFullName public function Get the full filename with extensions. 1
BackupFileInterface::getMeta public function Get a metadata value. 1
BackupFileInterface::getMetaAll public function Get all meta data as an array. 1
BackupFileInterface::getName public function Get the file name without extension. 1
BackupFileInterface::setExtList public function Set the extension array for the file to the given array. 1
BackupFileInterface::setFullName public function Set the full filename with extensions. 1
BackupFileInterface::setMeta public function Set a metadata value. 2
BackupFileInterface::setMetaMultiple public function Set a metadata value. 2
BackupFileInterface::setName public function Set the file name without extension. 1