WrapperPluginBase.php in Backup and Migrate 5.0.x
File
src/Drupal/EntityPlugins/WrapperPluginBase.php
View source
<?php
namespace Drupal\backup_migrate\Drupal\EntityPlugins;
use Drupal\backup_migrate\Core\Config\Config;
use Drupal\backup_migrate\Core\Main\BackupMigrateInterface;
use Drupal\Component\Plugin\PluginBase;
abstract class WrapperPluginBase extends PluginBase implements WrapperPluginInterface {
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->setConfiguration($configuration);
}
public function getObject() {
$info = $this
->getPluginDefinition();
if ($info['wrapped_class']) {
return new $info['wrapped_class']($this
->getConfig());
}
}
public abstract function alterBackupMigrate(BackupMigrateInterface $bam, $key, array $options = []);
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) {
$this->configuration = $configuration;
}
public function defaultConfiguration() {
return [];
}
public function calculateDependencies() {
return [];
}
public function getConfig() {
return new Config($this
->getConfiguration());
}
}