You are here

public static function NodeImport::nodeImport in Node export 8

Batch operations method to import a given node object.

Parameters

array $nodeArray: An exported node array.

array $context: An array of contextual key/value information for rebuild batch process.

File

src/NodeImport.php, line 123

Class

NodeImport
Provides a Node Import function.

Namespace

Drupal\node_export

Code

public static function nodeImport(array $nodeArray, array &$context) {
  $message = 'Importing Nodes...';
  $context['message'] = $message;
  $id = NodeImport::import($nodeArray);
  if ($id) {
    $context['results']['imported'][] = $id;
  }
  else {
    $context['results']['not_imported'][] = $id;
  }
}