protected function ContentEntityStorageTrait::trackConflicts in Multiversion 8
Same name and namespace in other branches
- 8.2 src/Entity/Storage/ContentEntityStorageTrait.php \Drupal\multiversion\Entity\Storage\ContentEntityStorageTrait::trackConflicts()
Uses the Conflict Tracker service to track conflicts for an entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to track for which to track conflicts.
1 call to ContentEntityStorageTrait::trackConflicts()
- ContentEntityStorageTrait::save in src/
Entity/ Storage/ ContentEntityStorageTrait.php
File
- src/
Entity/ Storage/ ContentEntityStorageTrait.php, line 604
Class
Namespace
Drupal\multiversion\Entity\StorageCode
protected function trackConflicts(EntityInterface $entity) {
$workspace = isset($entity->workspace) ? $entity->workspace->entity : null;
/** @var \Drupal\multiversion\Workspace\ConflictTrackerInterface $conflictTracker */
$conflictTracker = \Drupal::service('workspace.conflict_tracker')
->useWorkspace($workspace);
$index_factory = \Drupal::service('multiversion.entity_index.factory');
/** @var \Drupal\multiversion\Entity\Index\RevisionTreeIndexInterface $tree */
$tree = $index_factory
->get('multiversion.entity_index.rev.tree', $workspace);
$conflicts = $tree
->getConflicts($entity
->uuid());
if ($conflicts) {
$conflictTracker
->add($entity
->uuid(), $conflicts, TRUE);
}
else {
$conflictTracker
->resolveAll($entity
->uuid());
}
}