abstract class DestinationBase in Backup and Migrate 5.0.x
@package Drupal\backup_migrate\Core\Destination
Hierarchy
- class \Drupal\backup_migrate\Core\Plugin\PluginBase implements ConfigurableInterface, PluginInterface uses ConfigurableTrait
- class \Drupal\backup_migrate\Core\Destination\DestinationBase implements ReadableDestinationInterface, WritableDestinationInterface
Expanded class hierarchy of DestinationBase
File
- src/
Core/ Destination/ DestinationBase.php, line 15
Namespace
Drupal\backup_migrate\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
->saveTheFile($file);
$this
->saveTheFileMetadata($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
->deleteTheFile($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 deleteTheFile($id);
/**
* Do the actual file save.
*
* Should take care of the actual creation of a file in the destination
* without regard for metadata.
*
* @param \Drupal\backup_migrate\Core\File\BackupFileReadableInterface $file
*/
protected abstract function saveTheFile(BackupFileReadableInterface $file);
/**
* Do the metadata save.
*
* This function is called to save the data file AND the metadata sidecar
* file.
*
* @param \Drupal\backup_migrate\Core\File\BackupFileInterface $file
*/
protected abstract function saveTheFileMetadata(BackupFileInterface $file);
/**
* Load the actual metadata for the file.
*
* @param \Drupal\backup_migrate\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. | |
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:: |
abstract protected | function | Do the actual delete for a file. | 1 |
DestinationBase:: |
public | function | ||
DestinationBase:: |
public | function |
Load the metadata for the given file however it may be stored. Overrides ReadableDestinationInterface:: |
|
DestinationBase:: |
abstract protected | function | Load the actual metadata for the file. | |
DestinationBase:: |
public | function |
Save a file to the destination. Overrides WritableDestinationInterface:: |
1 |
DestinationBase:: |
abstract protected | function | Do the actual file save. | 1 |
DestinationBase:: |
abstract protected | function | Do the metadata save. | |
DestinationBase:: |
public | function |
Get a list of supported operations and their weight. Overrides PluginBase:: |
|
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 dest. | 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. |