You are here

public function ContentEntityConflictHandler::prepareConflictResolution in Conflict 8.2

Prepares the entity for the manual conflict resolution.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The current entity.

\Drupal\Core\Entity\EntityInterface $entity_server: (optional) The server entity i.e. the current entity from the storage or NULL if the entity has been deleted or in case of inline reference the relationship was removed.

Overrides EntityConflictHandlerInterface::prepareConflictResolution

1 call to ContentEntityConflictHandler::prepareConflictResolution()
ContentEntityConflictHandler::entityFormEntityBuilder in src/Entity/ContentEntityConflictHandler.php
Entity builder method.

File

src/Entity/ContentEntityConflictHandler.php, line 659

Class

ContentEntityConflictHandler

Namespace

Drupal\conflict\Entity

Code

public function prepareConflictResolution(EntityInterface $entity, EntityInterface $entity_server = NULL) {

  // Manual merge is needed if even after the auto-merge of non-edited
  // translations, fields with no edit access and entity metadata there
  // are still conflicts in the current translation and/or
  // non-translatable fields.
  $entity->{static::CONFLICT_ENTITY_NEEDS_MANUAL_MERGE} = TRUE;

  // Append the server entity that will be used for building the manual
  // conflict resolution.
  $entity->{static::CONFLICT_ENTITY_SERVER} = $entity_server ?? 'removed';
}