trait PluginCallerTrait in Backup and Migrate 5.0.x
Implements the injection code for a PluginCallerInterface object.
@package Drupal\backup_migrate\Core\Plugin
Hierarchy
- trait \Drupal\backup_migrate\Core\Plugin\PluginCallerTrait
6 files declare their use of PluginCallerTrait
- BackupMigrate.php in src/
Core/ Main/ BackupMigrate.php - BrowserDownloadDestination.php in src/
Core/ Destination/ BrowserDownloadDestination.php - FileDirectorySource.php in src/
Core/ Source/ FileDirectorySource.php - MetadataWriter.php in src/
Core/ Filter/ MetadataWriter.php - MySQLiSource.php in src/
Core/ Source/ MySQLiSource.php
File
- src/
Core/ Plugin/ PluginCallerTrait.php, line 10
Namespace
Drupal\backup_migrate\Core\PluginView source
trait PluginCallerTrait {
/**
* @var \Drupal\backup_migrate\Core\Plugin\PluginManagerInterface
*/
protected $plugins;
/**
* Inject the plugin manager.
*
* @param \Drupal\backup_migrate\Core\Plugin\PluginManagerInterface $plugins
*/
public function setPluginManager(PluginManagerInterface $plugins) {
$this->plugins = $plugins;
}
/**
* Get the plugin manager.
*
* @return \Drupal\backup_migrate\Core\Plugin\PluginManagerInterface
*/
public function plugins() {
// Return the list of plugins or a blank placeholder.
return $this->plugins ? $this->plugins : new PluginManager();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginCallerTrait:: |
protected | property | ||
PluginCallerTrait:: |
public | function | Get the plugin manager. | |
PluginCallerTrait:: |
public | function | Inject the plugin manager. |