class WorkspaceOperationFactory
Same name and namespace in other branches
- 10 core/modules/workspaces/src/WorkspaceOperationFactory.php \Drupal\workspaces\WorkspaceOperationFactory
- 9 core/modules/workspaces/src/WorkspaceOperationFactory.php \Drupal\workspaces\WorkspaceOperationFactory
- 8.9.x core/modules/workspaces/src/WorkspaceOperationFactory.php \Drupal\workspaces\WorkspaceOperationFactory
Defines a factory class for workspace operations.
@internal
Hierarchy
- class \Drupal\workspaces\WorkspaceOperationFactory
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 - WorkspacePublisherTest.php in core/
modules/ workspaces/ tests/ src/ Kernel/ WorkspacePublisherTest.php - WorkspacePublishForm.php in core/
modules/ workspaces/ src/ Form/ WorkspacePublishForm.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 20
Namespace
Drupal\workspacesView source
class WorkspaceOperationFactory {
public function __construct(protected EntityTypeManagerInterface $entityTypeManager, protected Connection $database, protected WorkspaceManagerInterface $workspaceManager, protected WorkspaceAssociationInterface $workspaceAssociation, protected EventDispatcherInterface $eventDispatcher, #[Autowire(service: 'logger.channel.workspaces')] protected LoggerInterface $logger, protected ?TimeInterface $time = NULL) {
if ($time === NULL) {
@trigger_error('Calling ' . __CLASS__ . ' constructor without the $time argument is deprecated in drupal:11.3.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/project/drupal/issues/3531037', E_USER_DEPRECATED);
$this->time = \Drupal::time();
}
}
/**
* 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, $this->time);
}
/**
* 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.