You are here

abstract class RepositoryHandlerBase in Workspace 8.2

Defines a base RepositoryHandler plugin implementation.

Hierarchy

Expanded class hierarchy of RepositoryHandlerBase

See also

\Drupal\workspace\RepositoryHandlerInterface

\Drupal\workspace\RepositoryHandlerManager

\Drupal\workspace\Annotation\RepositoryHandler

Plugin API

1 file declares its use of RepositoryHandlerBase
LiveRepositoryHandler.php in src/Plugin/RepositoryHandler/LiveRepositoryHandler.php

File

src/RepositoryHandlerBase.php, line 16

Namespace

Drupal\workspace
View source
abstract class RepositoryHandlerBase extends PluginBase implements RepositoryHandlerInterface {
  use DependencyTrait;

  /**
   * The source repository identifier.
   *
   * @var string
   */
  protected $source;

  /**
   * The target repository identifier.
   *
   * @var string
   */
  protected $target;

  /**
   * {@inheritdoc}
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    if (!isset($configuration['source'])) {
      throw new \InvalidArgumentException('Missing repository handler source configuration');
    }
    if (!isset($configuration['target'])) {
      throw new \InvalidArgumentException('Missing repository handler target configuration');
    }
    $this->source = $configuration['source'];
    $this->target = $configuration['target'];
  }

  /**
   * {@inheritdoc}
   */
  public function getLabel() {
    return $this
      ->getPluginDefinition()['label'];
  }

  /**
   * {@inheritdoc}
   */
  public function getDescription() {
    return $this
      ->getPluginDefinition()['description'];
  }

  /**
   * {@inheritdoc}
   */
  public function calculateDependencies() {
    return [];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
DependencyTrait::$dependencies protected property The object's dependencies.
DependencyTrait::addDependencies protected function Adds multiple dependencies.
DependencyTrait::addDependency protected function Adds a dependency.
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
RepositoryHandlerBase::$source protected property The source repository identifier.
RepositoryHandlerBase::$target protected property The target repository identifier.
RepositoryHandlerBase::calculateDependencies public function 1
RepositoryHandlerBase::getDescription public function Returns the repository handler plugin description. Overrides RepositoryHandlerInterface::getDescription
RepositoryHandlerBase::getLabel public function Returns the label of the repository handler. Overrides RepositoryHandlerInterface::getLabel
RepositoryHandlerBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase::__construct 1
RepositoryHandlerInterface::checkConflictsOnTarget public function Checks if there are any conflicts between the source and the target. 2
RepositoryHandlerInterface::CONFLICT_DELETE_ON_CHANGE constant Indicate that an item deleted on the source has been changed on the target.
RepositoryHandlerInterface::CONFLICT_UPDATE_ON_CHANGE constant Indicate that an item has been updated both on the source and the target.
RepositoryHandlerInterface::CONFLICT_UPDATE_ON_DELETE constant Indicate that an item updated on the source has been deleted on the target.
RepositoryHandlerInterface::getDifferringRevisionIdsOnSource public function Gets the revision identifiers for items which have changed on the source. 2
RepositoryHandlerInterface::getDifferringRevisionIdsOnTarget public function Gets the revision identifiers for items which have changed on the target. 2
RepositoryHandlerInterface::getNumberOfChangesOnSource public function Gets the total number of items which have changed on the source. 2
RepositoryHandlerInterface::getNumberOfChangesOnTarget public function Gets the total number of items which have changed on the target. 2
RepositoryHandlerInterface::pull public function Pulls content from a target repository to a source repository. 2
RepositoryHandlerInterface::push public function Pushes content from a source repository to a target repository. 2
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.