function WorkspaceMerger::__construct

Same name in other branches
  1. 9 core/modules/workspaces/src/WorkspaceMerger.php \Drupal\workspaces\WorkspaceMerger::__construct()
  2. 8.9.x core/modules/workspaces/src/WorkspaceMerger.php \Drupal\workspaces\WorkspaceMerger::__construct()
  3. 11.x core/modules/workspaces/src/WorkspaceMerger.php \Drupal\workspaces\WorkspaceMerger::__construct()

Constructs a new WorkspaceMerger.

Parameters

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

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

\Drupal\workspaces\WorkspaceAssociationInterface $workspace_association: The workspace association service.

\Drupal\workspaces\WorkspaceInterface $source: The source workspace.

\Drupal\workspaces\WorkspaceInterface $target: The target workspace.

\Psr\Log\LoggerInterface|null $logger: The logger.

File

core/modules/workspaces/src/WorkspaceMerger.php, line 69

Class

WorkspaceMerger
Default implementation of the workspace merger.

Namespace

Drupal\workspaces

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, Connection $database, WorkspaceAssociationInterface $workspace_association, WorkspaceInterface $source, WorkspaceInterface $target, ?LoggerInterface $logger = NULL) {
    $this->entityTypeManager = $entity_type_manager;
    $this->database = $database;
    $this->workspaceAssociation = $workspace_association;
    $this->sourceWorkspace = $source;
    $this->targetWorkspace = $target;
    if ($this->logger === NULL) {
        @trigger_error('Calling ' . __METHOD__ . '() without the $logger argument is deprecated in drupal:10.1.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/2932520', E_USER_DEPRECATED);
        $this->logger = \Drupal::service('logger.channel.workspaces');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.