abstract class DestinationBase in Backup and Migrate 8.4
Class DestinationBase.
@package BackupMigrate\Core\Destination
Hierarchy
- class \BackupMigrate\Core\Plugin\PluginBase implements ConfigurableInterface, PluginInterface uses ConfigurableTrait
- class \BackupMigrate\Core\Destination\DestinationBase implements ReadableDestinationInterface, WritableDestinationInterface
Expanded class hierarchy of DestinationBase
File
- lib/
backup_migrate_core/ src/ Destination/ DestinationBase.php, line 15
Namespace
BackupMigrate\Core\DestinationView source
abstract class DestinationBase extends PluginBase implements ReadableDestinationInterface, WritableDestinationInterface {
/**
* Get a list of supported operations and their weight.
*
* @return array
*/
public function supportedOps() {
return [];
}
/**
* {@inheritdoc}
*/
public function saveFile(BackupFileReadableInterface $file) {
$this
->_saveFile($file);
$this
->_saveFileMetadata($file);
}
/**
* {@inheritdoc}
*/
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;
}
/**
* {@inheritdoc}
*/
public function deleteFile($id) {
return $this
->_deleteFile($id);
}
/**
* {@inheritdoc}
*/
public function isRemote() {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function checkWritable() {
throw new DestinationNotWritableException('The specified destination cannot be written to.');
}
/**
* Do the actual delete for a file.
*
* @param string $id The id of the file to delete.
*/
protected abstract function _deleteFile($id);
/**
* Do the actual file save. Should take care of the actual creation of a file
* in the destination without regard for metadata.
*
* @param \BackupMigrate\Core\File\BackupFileReadableInterface $file
*/
protected abstract function _saveFile(BackupFileReadableInterface $file);
/**
* Do the metadata save. This function is called to save the data file AND
* the metadata sidecar file.
*
* @param \BackupMigrate\Core\File\BackupFileInterface $file
*/
protected abstract function _saveFileMetadata(BackupFileInterface $file);
/**
* Load the actual metadata for the file.
*
* @param \BackupMigrate\Core\File\BackupFileInterface $file
*/
protected abstract function _loadFileMetadataArray(BackupFileInterface $file);
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableTrait:: |
protected | property | The object's configuration object. | |
ConfigurableTrait:: |
protected | property | The initial configuration. These configuration options can be overriden by the config options but will not be overwritten. If the object is re-configured after construction any missing configuration options will revert to these values. | |
ConfigurableTrait:: |
public | function | Get a specific value from the configuration. | |
ConfigurableTrait:: |
public | function | Get the configuration object for this item. | |
ConfigurableTrait:: |
public | function | Get the default values for the plugin. | 10 |
ConfigurableTrait:: |
public | function | Get any validation errors in the config. | |
ConfigurableTrait:: |
public | function | Get a default (blank) schema. | 10 |
ConfigurableTrait:: |
public | function | Set the configuration for all plugins. | 1 |
ConfigurableTrait:: |
public | function | 2 | |
DestinationBase:: |
public | function | 1 | |
DestinationBase:: |
public | function | ||
DestinationBase:: |
public | function | ||
DestinationBase:: |
public | function |
Load the metadata for the given file however it may be stored. Overrides ReadableDestinationInterface:: |
|
DestinationBase:: |
public | function |
Save a file to the destination. Overrides WritableDestinationInterface:: |
1 |
DestinationBase:: |
public | function |
Get a list of supported operations and their weight. Overrides PluginBase:: |
|
DestinationBase:: |
abstract protected | function | Do the actual delete for a file. | 1 |
DestinationBase:: |
abstract protected | function | Load the actual metadata for the file. | |
DestinationBase:: |
abstract protected | function | Do the actual file save. Should take care of the actual creation of a file in the destination without regard for metadata. | 1 |
DestinationBase:: |
abstract protected | function | Do the metadata save. This function is called to save the data file AND the metadata sidecar file. | |
PluginBase:: |
public | function |
What is the weight of the given operation for this plugin. Overrides PluginInterface:: |
|
PluginBase:: |
public | function |
Does this plugin implement the given operation. Overrides PluginInterface:: |
|
ReadableDestinationInterface:: |
public | function | Does the file with the given id (filename) exist in this destination. | 2 |
ReadableDestinationInterface:: |
public | function | Get a file object representing the file with the given ID from the destination. This file item will not necessarily be readable nor will it have extended metadata loaded. Use loadForReading and loadFileMetadata to get those. | 2 |
ReadableDestinationInterface:: |
public | function | Load the file with the given ID from the destination. | 2 |
TranslatableTrait:: |
protected | property | ||
TranslatableTrait:: |
public | function | ||
TranslatableTrait:: |
public | function | Translate the given string if there is a translator service available. |