You are here

function gathercontent_import_process in GatherContent 8.3

Same name and namespace in other branches
  1. 8.5 gathercontent.module \gathercontent_import_process()
  2. 8.4 gathercontent.module \gathercontent_import_process()
  3. 7.3 gathercontent.import.inc \gathercontent_import_process()

Batch operation callback.

We are doing real import thing here.

Parameters

int $gc_id: ID of content we want to import.

int $status_id: ID of status, if 0 then we don't want to change status.

string $operation_uuid: UUID of operation.

bool $drupal_status: Status on node in Drupal - published/unpublished.

string $node_update_method: Name of the node update method.

int|null $parent_menu_item: ID of mlid.

array $context: Context of operation.

2 string references to 'gathercontent_import_process'
ContentImportSelectForm::submitForm in src/Form/ContentImportSelectForm.php
Form submission handler.
drush_gathercontent_import in ./gathercontent.drush.inc
Implements drush_COMMAND().

File

./gathercontent.module, line 805
Main module file for GatherContent module.

Code

function gathercontent_import_process($gc_id, $status_id, $operation_uuid, $drupal_status, $node_update_method, $parent_menu_item = NULL, array &$context = []) {
  if (($nid = _gc_fetcher($gc_id, $operation_uuid, $drupal_status, $node_update_method, $status_id, $parent_menu_item)) !== FALSE) {
    if ($status_id != 0) {

      // Change status.
      $content_obj = new Content();
      $content_obj
        ->updateStatus($gc_id, $status_id);
    }
  }
  $context['results']['uuid'] = $operation_uuid;
}