You are here

public function StateInformation::getImportStatusOfEntity in Entity Share 8.3

Gets the dedicated "Entity import status" entity for imported entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity being imported.

Return value

\Drupal\entity_share_client\Entity\EntityImportStatusInterface|bool The "Entity import status" entity or FALSE if none found.

Overrides StateInformationInterface::getImportStatusOfEntity

1 call to StateInformation::getImportStatusOfEntity()
StateInformation::entityHasChanged in modules/entity_share_client/src/Service/StateInformation.php
Checks if the entity has changed on Remote before import.

File

modules/entity_share_client/src/Service/StateInformation.php, line 295

Class

StateInformation
Service to handle presentation of import state.

Namespace

Drupal\entity_share_client\Service

Code

public function getImportStatusOfEntity(ContentEntityInterface $entity) {
  $entity_storage = $this->entityTypeManager
    ->getStorage('entity_import_status');
  $langcode = NULL;
  if ($entity_storage
    ->getEntityType()
    ->hasKey('langcode')) {
    $langcode = $entity
      ->language()
      ->getId();
  }
  return $this
    ->getImportStatusByParameters($entity
    ->uuid(), $entity
    ->getEntityTypeId(), $langcode);
}