You are here

protected function ReplicatorManager::queueReplication in Workspace 8

Queue a new replication.

Parameters

\Drupal\workspace\Entity\Replication $replication: The replication.

\Drupal\replication\ReplicationTask\ReplicationTaskInterface $task: The replication task.

Throws

\Drupal\Core\Entity\EntityStorageException

2 calls to ReplicatorManager::queueReplication()
ReplicatorManager::replicate in src/ReplicatorManager.php
Perform the replication from the source to target workspace.
ReplicatorManager::update in src/ReplicatorManager.php
Update the target using the source before doing a replication.

File

src/ReplicatorManager.php, line 307

Class

ReplicatorManager
Provides the Replicator manager.

Namespace

Drupal\workspace

Code

protected function queueReplication(Replication $replication, ReplicationTaskInterface $task) {
  $replication
    ->setReplicationStatusQueued();
  $replication
    ->save();
  $this->queue
    ->createItem([
    'task' => $task,
    'replication' => $replication,
  ]);
  $this->eventDispatcher
    ->dispatch(ReplicationEvents::QUEUED_REPLICATION, new ReplicationEvent($replication));
}