Commit ea9500c5 authored by mxh's avatar mxh
Browse files

Issue #3325769 by mxh: Support translatability of content

parent d590108d
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -134,10 +134,26 @@ class EntitySynchronization {
    $this->setEnabled(TRUE);
  }

  /**
   * Registers an entity for synchronization.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity to register.
   * @param \Drupal\parameters\Entity\ParametersCollectionInterface $collection
   *   The collection that holds the configuration of the given entity.
   */
  public function register(EntityInterface $entity, ParametersCollectionInterface $collection): void {
    $this->state->set($this->getStateKey($entity), $collection->id());
  }

  /**
   * Un-registers an entity from synchronization.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity to register.
   * @param \Drupal\parameters\Entity\ParametersCollectionInterface $collection
   *   The collection that holds (or held) the config of the given entity.
   */
  public function unregister(EntityInterface $entity, ParametersCollectionInterface $collection): void {
    $this->state->delete($this->getStateKey($entity));
  }