You are here

private function ImportEntityManager::saveImportedEntity in Acquia Content Hub 8

Save the imported entity.

1 call to ImportEntityManager::saveImportedEntity()
ImportEntityManager::trackImportedEntity in src/ImportEntityManager.php
Save this entity in the Tracking table.

File

src/ImportEntityManager.php, line 871

Class

ImportEntityManager
Provides a service for managing imported entities' actions.

Namespace

Drupal\acquia_contenthub

Code

private function saveImportedEntity() {

  // Now save the entity.
  $success = $this->contentHubEntitiesTracking
    ->save();

  // Log event.
  if (!$success) {
    $args = [
      '%type' => $this->contentHubEntitiesTracking
        ->getEntityType(),
      '%uuid' => $this->contentHubEntitiesTracking
        ->getUuid(),
    ];
    $message = $this
      ->t('Imported entity type = %type with uuid=%uuid could not be saved in the tracking table.', $args);
  }
  else {
    $args = [
      '%type' => $this->contentHubEntitiesTracking
        ->getEntityType(),
      '%uuid' => $this->contentHubEntitiesTracking
        ->getUuid(),
    ];
    $message = $this
      ->t('Saving %type entity with uuid=%uuid. Tracking imported entity with auto updates.', $args);
  }
  $this->loggerFactory
    ->get('acquia_contenthub')
    ->debug($message);
}