class WorkspaceOperationFactory

Same name in other branches
  1. 9 core/modules/workspaces/src/WorkspaceOperationFactory.php \Drupal\workspaces\WorkspaceOperationFactory
  2. 8.9.x core/modules/workspaces/src/WorkspaceOperationFactory.php \Drupal\workspaces\WorkspaceOperationFactory
  3. 10 core/modules/workspaces/src/WorkspaceOperationFactory.php \Drupal\workspaces\WorkspaceOperationFactory

Defines a factory class for workspace operations.

@internal

Hierarchy

Expanded class hierarchy of WorkspaceOperationFactory

See also

\Drupal\workspaces\WorkspaceOperationInterface

\Drupal\workspaces\WorkspacePublisherInterface

3 files declare their use of WorkspaceOperationFactory
WorkspaceMergeForm.php in core/modules/workspaces/src/Form/WorkspaceMergeForm.php
WorkspacePublishForm.php in core/modules/workspaces/src/Form/WorkspacePublishForm.php
WorkspacePublishFormTest.php in core/modules/workspaces/tests/src/Kernel/WorkspacePublishFormTest.php
1 string reference to 'WorkspaceOperationFactory'
workspaces.services.yml in core/modules/workspaces/workspaces.services.yml
core/modules/workspaces/workspaces.services.yml
1 service uses WorkspaceOperationFactory
workspaces.operation_factory in core/modules/workspaces/workspaces.services.yml
Drupal\workspaces\WorkspaceOperationFactory

File

core/modules/workspaces/src/WorkspaceOperationFactory.php, line 18

Namespace

Drupal\workspaces
View source
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);
    }

}

Members

Title Sort descending Modifiers Object type Summary
WorkspaceOperationFactory::getMerger public function Gets the workspace merger.
WorkspaceOperationFactory::getPublisher public function Gets the workspace publisher.
WorkspaceOperationFactory::__construct public function

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