You are here

public function BatchGenerator::performActionProcess in User Merge 2.x

Runs batch steps for action plugin.

Parameters

string $plugin_id: Property plugin id.

int $retire_id: Retire user id.

int $retain_id: Retain user id.

mixed &$context: The Batch API context.

Throws

\Drupal\Component\Plugin\Exception\PluginException

File

src/BatchGenerator.php, line 140

Class

BatchGenerator
Class BatchGenerator.

Namespace

Drupal\usermerge

Code

public function performActionProcess($plugin_id, $retire_id, $retain_id, &$context) {
  if (isset($context['results']['skip'])) {
    return;
  }
  try {
    $retire = $this
      ->loadAccount($retire_id);
    $retain = $this
      ->loadAccount($retain_id);
    $this->userMerger
      ->applyAction($plugin_id, $retire, $retain);
  } catch (UserMergeException $e) {
    $context['results']['skip'] = TRUE;
    $context['results']['error'] = $e
      ->getMessage();
  }
}