You are here

public function ImportEntityManager::import in Acquia Content Hub 8

Import an entity.

Parameters

string $uuid: The UUID of the Entity to save.

bool $include_dependencies: TRUE if we want to save all its dependencies, FALSE otherwise.

string $author: The UUID of the author (user) that will own the entity.

int $status: The publishing status of the entity (Applies to nodes).

Return value

\Symfony\Component\HttpFoundation\JsonResponse A JSON Response.

File

src/ImportEntityManager.php, line 411

Class

ImportEntityManager
Provides a service for managing imported entities' actions.

Namespace

Drupal\acquia_contenthub

Code

public function import($uuid, $include_dependencies = TRUE, $author = NULL, $status = 0) {
  if (\Drupal::config('acquia_contenthub.entity_config')
    ->get('import_with_queue')) {
    return $this
      ->addEntityToImportQueue($uuid, $include_dependencies, $author, $status);
  }
  return $this
    ->importRemoteEntity($uuid, $include_dependencies, $author, $status);
}