You are here

public function LiveRepositoryHandler::__construct in Workspace 8.2

Constructs a new LiveRepositoryHandler.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Database\Connection $database: Database connection.

Overrides RepositoryHandlerBase::__construct

File

src/Plugin/RepositoryHandler/LiveRepositoryHandler.php, line 73

Class

LiveRepositoryHandler
Defines a plugin which replicates content to the default (Live) workspace.

Namespace

Drupal\workspace\Plugin\RepositoryHandler

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, Connection $database) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->entityTypeManager = $entity_type_manager;
  $this->database = $database;
  $this->workspaceAssociationStorage = $entity_type_manager
    ->getStorage('workspace_association');
  $this->sourceWorkspace = $this->entityTypeManager
    ->getStorage('workspace')
    ->load($this->source);
  $this->targetWorkspace = $this->entityTypeManager
    ->getStorage('workspace')
    ->load($this->target);
}