You are here

interface PluginManagerInterface in Backup and Migrate 8.4

Manage all of the available Plugins.

Hierarchy

Expanded class hierarchy of PluginManagerInterface

All classes that implement PluginManagerInterface

5 files declare their use of PluginManagerInterface
BackupMigrate.php in lib/backup_migrate_core/src/Main/BackupMigrate.php
BackupMigrateInterface.php in lib/backup_migrate_core/src/Main/BackupMigrateInterface.php
DrupalConfigHelper.php in src/Config/DrupalConfigHelper.php
PluginCallerInterface.php in lib/backup_migrate_core/src/Plugin/PluginCallerInterface.php
PluginCallerTrait.php in lib/backup_migrate_core/src/Plugin/PluginCallerTrait.php

File

lib/backup_migrate_core/src/Plugin/PluginManagerInterface.php, line 10

Namespace

BackupMigrate\Core\Plugin
View source
interface PluginManagerInterface {

  /**
   * Add an item to the manager.
   *
   * @param $id
   * @param \BackupMigrate\Core\Plugin\PluginInterface|object $item
   *    The source to add.
   *
   * @return
   */
  public function add($id, PluginInterface $item);

  /**
   * Get the item with the given id.
   *
   * @param $id
   *
   * @return \BackupMigrate\Core\Plugin\PluginInterface The item specified by the id or NULL if it doesn't exist.
   */
  public function get($id);

  /**
   * Get a list of all of the items.
   *
   * @return \BackupMigrate\Core\Plugin\PluginInterface[] An ordered list of the sources, keyed by their id.
   */
  public function getAll();

  /**
   * Set the configuration for all plugins.
   *
   * @param ConfigInterface $config A configuration object containing only configuration for all plugins
   */

  // public function setConfig(ConfigInterface $config);

  /**
   * Get all plugins that implement the given operation.
   *
   * @param string $op The name of the operation.
   *
   * @return \BackupMigrate\Core\Plugin\PluginInterface[]
   */
  public function getAllByOp($op);

  /**
   * Call all plugins which support the given operation.
   *
   * If an operand is used it is passed to each operator and should be returned
   * by each one. Not all operations require an operand in which case this will
   * be NULL.
   *
   * Params is an array of extra params which may be used. Plugins should expect
   * these to be passed as a keyed array.
   *
   * @param string $op
   *    The name of the operation to be called.
   * @param mixed $operand
   *    If there in an object being operated on (eg. a backup file) it will be
   *    passed to each plugin in succession. If not then this will be NULL.
   * @param array $params
   *    Optional operation parameters as a key/value array
   *
   * @return mixed
   */
  public function call($op, $operand = NULL, $params = []);

  /**
   * Call all plugins which support the given operation. Return the results in
   * an array keyed by the plugin id.
   *
   * Params is an array of extra params which may be used. Plugins should expect
   * these to be passed as a keyed array.
   *
   * @param string $op
   *    The name of the operation to be called.
   * @param mixed $operand
   *    If there in an object being operated on (eg. a backup file) it will be
   *    passed to each plugin in succession. If not then this will be NULL.
   * @param array $params
   *    Optional operation parameters as a key/value array
   *
   * @return array
   */
  public function map($op, $params = []);

  /**
   * Set the configuration for all plugins.
   *
   * @param ConfigInterface $config
   *    A configuration object containing only configuration for all plugins
   */
  public function setConfig(ConfigInterface $config);

}

Members

Namesort descending Modifiers Type Description Overrides
PluginManagerInterface::add public function Add an item to the manager. 1
PluginManagerInterface::call public function Call all plugins which support the given operation. 1
PluginManagerInterface::get public function Get the item with the given id. 1
PluginManagerInterface::getAll public function Get a list of all of the items. 1
PluginManagerInterface::getAllByOp public function Get all plugins that implement the given operation. 1
PluginManagerInterface::map public function Call all plugins which support the given operation. Return the results in an array keyed by the plugin id. 1
PluginManagerInterface::setConfig public function Set the configuration for all plugins.