WrapperPluginBase.php in Backup and Migrate 8.4
File
src/EntityPlugins/WrapperPluginBase.php
View source
<?php
namespace BackupMigrate\Drupal\EntityPlugins;
use BackupMigrate\Core\Config\Config;
use BackupMigrate\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, $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());
}
}