trait PluginCallerTrait in Backup and Migrate 8.4
Class PluginCallerTrait.
@package BackupMigrate\Core\Plugin
Implements the injection code for a PluginCallerInterface object.
Hierarchy
- trait \BackupMigrate\Core\Plugin\PluginCallerTrait
6 files declare their use of PluginCallerTrait
- BackupMigrate.php in lib/
backup_migrate_core/ src/ Main/ BackupMigrate.php - BrowserDownloadDestination.php in lib/
backup_migrate_core/ src/ Destination/ BrowserDownloadDestination.php - FileDirectorySource.php in lib/
backup_migrate_core/ src/ Source/ FileDirectorySource.php - MetadataWriter.php in lib/
backup_migrate_core/ src/ Filter/ MetadataWriter.php - MySQLiSource.php in lib/
backup_migrate_core/ src/ Source/ MySQLiSource.php
File
- lib/
backup_migrate_core/ src/ Plugin/ PluginCallerTrait.php, line 14
Namespace
BackupMigrate\Core\PluginView source
trait PluginCallerTrait {
/**
* @var \BackupMigrate\Core\Plugin\PluginManagerInterface;
*/
protected $plugins;
/**
* Inject the plugin manager.
*
* @param \BackupMigrate\Core\Plugin\PluginManagerInterface $plugins
*/
public function setPluginManager(PluginManagerInterface $plugins) {
$this->plugins = $plugins;
}
/**
* Get the plugin manager.
*
* @return \BackupMigrate\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. |