You are here

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

Runs batch steps for property plugin.

Parameters

string $plugin_id: Property plugin id.

int $retire_id: Retire user id.

int $retain_id: Retain user id.

array $settings: Review settings.

mixed &$context: The Batch API context.

Throws

\Drupal\Component\Plugin\Exception\PluginException

File

src/BatchGenerator.php, line 173

Class

BatchGenerator
Class BatchGenerator.

Namespace

Drupal\usermerge

Code

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