You are here

public function ContentSynchronizerCommands::synchronizerImportZip in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Commands/ContentSynchronizerCommands.php \Drupal\content_synchronizer\Commands\ContentSynchronizerCommands::synchronizerImportZip()

Import from zip : bind together csci & cslim

@command content:synchronizer-import-zip @aliases csimzip

Parameters

$file_path: zip file

Throws

\Exception

File

src/Commands/ContentSynchronizerCommands.php, line 250

Class

ContentSynchronizerCommands
A Drush commandfile.

Namespace

Drupal\content_synchronizer\Commands

Code

public function synchronizerImportZip($file_path) {

  // 1 : create export
  $importId = $this
    ->synchronizerCreateImport($file_path, [
    'as_function' => TRUE,
  ]);

  // 2 : add all nodes of all node-types
  $this
    ->synchronizerLaunchImport($importId, [
    'publish' => 'publish',
    'update' => 'systematic',
  ]);
}