public function ConflictResolverManager::getConflicts in Conflict 8.2
Returns the conflicts between two entities based on their common parent. *
Parameters
\Drupal\Core\Entity\EntityInterface $local: The local part of the comparision - for example the entity built of the user input on an entity form submission. This is basically the active entity object.
\Drupal\Core\Entity\EntityInterface $remote: The remote part of the comparision - for example the current version of the entity from the storage.
\Drupal\Core\Entity\EntityInterface $base: The initial entity version in concurrent editing or the lowest common ancestor in a revision tree scenario.
\Symfony\Component\HttpFoundation\ParameterBag $context: (optional) The context parameter bag.
Return value
array An associative array keyed by the conflicting properties, having as values the corresponding conflict type.
Overrides ConflictResolverManagerInterface::getConflicts
1 call to ConflictResolverManager::getConflicts()
- ConflictResolverManager::resolveConflicts in src/
ConflictResolver/ ConflictResolverManager.php - Resolves the conflicts between two entities based on their common parent.
File
- src/
ConflictResolver/ ConflictResolverManager.php, line 55
Class
- ConflictResolverManager
- Manages conflict resolving.
Namespace
Drupal\conflict\ConflictResolverCode
public function getConflicts(EntityInterface $local, EntityInterface $remote, EntityInterface $base, ParameterBag $context = NULL) : array {
$event = new EntityConflictDiscoveryEvent($local, $remote, $base, $context);
// Fire an event to allow listeners to build a list of conflicting
// properties.
$this->eventDispatcher
->dispatch(EntityConflictEvents::ENTITY_CONFLICT_DISCOVERY, $event);
return $event
->getConflicts();
}