WorkspaceOperationFactory.php
Same filename in other branches
Namespace
Drupal\workspacesFile
-
core/
modules/ workspaces/ src/ WorkspaceOperationFactory.php
View source
<?php
namespace Drupal\workspaces;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
/**
* Defines a factory class for workspace operations.
*
* @see \Drupal\workspaces\WorkspaceOperationInterface
* @see \Drupal\workspaces\WorkspacePublisherInterface
*
* @internal
*/
class WorkspaceOperationFactory {
public function __construct(EntityTypeManagerInterface $entityTypeManager, Connection $database, WorkspaceManagerInterface $workspaceManager, WorkspaceAssociationInterface $workspaceAssociation, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger) {
}
/**
* Gets the workspace publisher.
*
* @param \Drupal\workspaces\WorkspaceInterface $source
* A workspace entity.
*
* @return \Drupal\workspaces\WorkspacePublisherInterface
* A workspace publisher object.
*/
public function getPublisher(WorkspaceInterface $source) {
return new WorkspacePublisher($this->entityTypeManager, $this->database, $this->workspaceManager, $this->workspaceAssociation, $this->eventDispatcher, $source, $this->logger);
}
/**
* Gets the workspace merger.
*
* @param \Drupal\workspaces\WorkspaceInterface $source
* The source workspace entity.
* @param \Drupal\workspaces\WorkspaceInterface $target
* The target workspace entity.
*
* @return \Drupal\workspaces\WorkspaceMergerInterface
* A workspace merger object.
*/
public function getMerger(WorkspaceInterface $source, WorkspaceInterface $target) {
return new WorkspaceMerger($this->entityTypeManager, $this->database, $this->workspaceAssociation, $source, $target, $this->logger);
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
WorkspaceOperationFactory | Defines a factory class for workspace operations. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.