You are here

public function ImportQueueResolver::resolve in Content Synchronization 3.0.x

Same name and namespace in other branches
  1. 8.2 src/DependencyResolver/ImportQueueResolver.php \Drupal\content_sync\DependencyResolver\ImportQueueResolver::resolve()

Creates a queue.

Parameters

array $normalized_entities: Parsed entities to import.

Return value

array Queue to be processed within a batch process.

Overrides ContentSyncResolverInterface::resolve

File

src/DependencyResolver/ImportQueueResolver.php, line 116

Class

ImportQueueResolver
Class ImportQueueResolver.

Namespace

Drupal\content_sync\DependencyResolver

Code

public function resolve(array $normalized_entities, $visited = []) {
  $visited = [];
  foreach ($normalized_entities as $identifier => $entity) {
    $this
      ->depthFirstSearch($visited, [
      $identifier,
    ], $normalized_entities);
  }

  // Reverse the array to adjust it to an array_pop-driven iterator.
  return array_reverse($visited);
}