abstract class PluginBase in Backup and Migrate 5.0.x
@package Drupal\backup_migrate\Core\Plugin
Hierarchy
- class \Drupal\backup_migrate\Core\Plugin\PluginBase implements ConfigurableInterface, PluginInterface uses ConfigurableTrait
Expanded class hierarchy of PluginBase
14 files declare their use of PluginBase
- CompressionFilter.php in src/
Core/ Filter/ CompressionFilter.php - DatabaseSource.php in src/
Core/ Source/ DatabaseSource.php - DBExcludeFilter.php in src/
Core/ Filter/ DBExcludeFilter.php - DestinationBase.php in src/
Core/ Destination/ DestinationBase.php - DrupalBrowserUploadDestination.php in src/
Drupal/ Destination/ DrupalBrowserUploadDestination.php
File
- src/
Core/ Plugin/ PluginBase.php, line 13
Namespace
Drupal\backup_migrate\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 string $op
* 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 string $op
* 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. | |
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. |