abstract class PluginBase in Backup and Migrate 8.4
Class PluginOperationTrait.
@package BackupMigrate\Core\Plugin
Hierarchy
- class \BackupMigrate\Core\Plugin\PluginBase implements ConfigurableInterface, PluginInterface uses ConfigurableTrait
Expanded class hierarchy of PluginBase
15 files declare their use of PluginBase
- CompressionFilter.php in lib/
backup_migrate_core/ src/ Filter/ CompressionFilter.php - DatabaseSource.php in lib/
backup_migrate_core/ src/ Source/ DatabaseSource.php - DBExcludeFilter.php in lib/
backup_migrate_core/ src/ Filter/ DBExcludeFilter.php - DestinationBase.php in lib/
backup_migrate_core/ src/ Destination/ DestinationBase.php - DrupalBrowserUploadDestination.php in src/
Destination/ DrupalBrowserUploadDestination.php
File
- lib/
backup_migrate_core/ src/ Plugin/ PluginBase.php, line 13
Namespace
BackupMigrate\Core\PluginView source
abstract class PluginBase implements PluginInterface, ConfigurableInterface {
use ConfigurableTrait;
/**
* Get a list of supported operations and their weight.
*
* An array of operations should take the form:
*
* [
* 'backup' => ['weight' => 100],
* 'restore' => ['weight' => -100],
* ];
*
* @return array
*/
public function supportedOps() {
return [];
}
/**
* Does this plugin implement the given operation.
*
* @param $op string The name of the operation
*
* @return bool
*/
public function supportsOp($op) {
// If the function has the method then it supports the op.
if (method_exists($this, $op)) {
return TRUE;
}
// If the supported ops array contains the op then it is supported.
$ops = $this
->supportedOps();
return isset($ops[$op]);
}
/**
* What is the weight of the given operation for this plugin.
* * @param $op string The name of the operation.
*
* @return int
*/
public function opWeight($op) {
$ops = $this
->supportedOps();
if (isset($ops[$op]['weight'])) {
return $ops[$op]['weight'];
}
return 0;
}
}
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 | |
PluginBase:: |
public | function |
What is the weight of the given operation for this plugin. Overrides PluginInterface:: |
|
PluginBase:: |
public | function |
Get a list of supported operations and their weight. Overrides PluginInterface:: |
8 |
PluginBase:: |
public | function |
Does this plugin implement the given operation. Overrides PluginInterface:: |
|
TranslatableTrait:: |
protected | property | ||
TranslatableTrait:: |
public | function | ||
TranslatableTrait:: |
public | function | Translate the given string if there is a translator service available. |