You are here

interface EntityConflictHandlerInterface in Conflict 8.2

Hierarchy

Expanded class hierarchy of EntityConflictHandlerInterface

All classes that implement EntityConflictHandlerInterface

5 files declare their use of EntityConflictHandlerInterface
conflict.module in ./conflict.module
The module that makes concurrent editing possible.
ConflictResolutionInlineFormBuilder.php in src/Form/ConflictResolutionInlineFormBuilder.php
conflict_paragraphs.module in modules/conflict_paragraphs/conflict_paragraphs.module
FieldComparatorParagraphReference.php in modules/conflict_paragraphs/src/Plugin/Conflict/FieldComparator/FieldComparatorParagraphReference.php
MergeRemoteStructure.php in modules/conflict_paragraphs/src/ConflictResolution/MergeRemoteStructure.php

File

src/Entity/EntityConflictHandlerInterface.php, line 8

Namespace

Drupal\conflict\Entity
View source
interface EntityConflictHandlerInterface {

  /**
   * The entity object property name to use to append the original entity.
   */
  const CONFLICT_ENTITY_ORIGINAL = 'conflictEntityOriginal';

  /**
   * The entity object property name to use to set the original entity's hash.
   */
  const CONFLICT_ENTITY_ORIGINAL_HASH = 'conflictEntityOriginalHash';

  /**
   * The entity object property name to use to append the merged server entity.
   */
  const CONFLICT_ENTITY_SERVER = 'conflictEntityServer';

  /**
   * The entity object property name to use to append the form display.
   */
  const CONFLICT_FORM_DISPLAY = 'conflictFormDisplay';

  /**
   * The entity object property name to use as a needs merge flag.
   */
  const CONFLICT_ENTITY_NEEDS_MANUAL_MERGE = 'conflictEntityNeedsManualMerge';

  /**
   * A constant defining the property name on fields for the conflict type.
   */
  const CONFLICT_TYPE_FIELD_PROPERTY = 'conflictType';

  /**
   * Performs the needed alterations to the entity form.
   *
   * @param array $form
   *   The entity form to be altered to provide the translation workflow.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity being created or edited.
   * @param bool $inline_entity_form
   *   (optional) TRUE if an inline entity form is given, FALSE if a regular
   *   entity form is given. Defaults to FALSE.
   */
  public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity, $inline_entity_form = FALSE);

  /**
   * Returns the entity conflicts.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity_local_original
   *   The locally edited entity.
   * @param \Drupal\Core\Entity\EntityInterface $entity_local_edited
   *   The original not edited entity used to build the form.
   * @param \Drupal\Core\Entity\EntityInterface $entity_server
   *   The unchanged entity loaded from the storage.
   *
   * @return array
   *   An array of conflicts, keyed by the field name having as value the
   *   conflict type.
   */
  public function getConflicts(EntityInterface $entity_local_original, EntityInterface $entity_local_edited, EntityInterface $entity_server);

  /**
   * Finishes the conflict resolution after the user interaction (manual merge).
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity.
   * @param array $path_parents
   *   The parents to the entity.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *  The current state of the form.
   */
  public function finishConflictResolution(EntityInterface $entity, $path_parents, FormStateInterface $form_state);

  /**
   * Prepares the entity for the manual conflict resolution.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The current entity.
   * @param \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.
   */
  public function prepareConflictResolution(EntityInterface $entity, EntityInterface $entity_server = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
EntityConflictHandlerInterface::CONFLICT_ENTITY_NEEDS_MANUAL_MERGE constant The entity object property name to use as a needs merge flag.
EntityConflictHandlerInterface::CONFLICT_ENTITY_ORIGINAL constant The entity object property name to use to append the original entity.
EntityConflictHandlerInterface::CONFLICT_ENTITY_ORIGINAL_HASH constant The entity object property name to use to set the original entity's hash.
EntityConflictHandlerInterface::CONFLICT_ENTITY_SERVER constant The entity object property name to use to append the merged server entity.
EntityConflictHandlerInterface::CONFLICT_FORM_DISPLAY constant The entity object property name to use to append the form display.
EntityConflictHandlerInterface::CONFLICT_TYPE_FIELD_PROPERTY constant A constant defining the property name on fields for the conflict type.
EntityConflictHandlerInterface::entityFormAlter public function Performs the needed alterations to the entity form. 1
EntityConflictHandlerInterface::finishConflictResolution public function Finishes the conflict resolution after the user interaction (manual merge). 1
EntityConflictHandlerInterface::getConflicts public function Returns the entity conflicts. 1
EntityConflictHandlerInterface::prepareConflictResolution public function Prepares the entity for the manual conflict resolution. 1