You are here

public function Migration::mergeProcessOfProperty in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::mergeProcessOfProperty()

Merge the process pipeline configuration for a single property.

Parameters

string $property: The property of which to merge the passed in process pipeline configuration.

array $process_of_property: The process pipeline configuration to be merged with the existing process pipeline configuration.

Return value

$this The migration entity.

Overrides MigrationInterface::mergeProcessOfProperty

See also

Drupal\migrate_drupal\Plugin\migrate\load\LoadEntity::processLinkField()

File

core/modules/migrate/src/Plugin/Migration.php, line 592

Class

Migration
Defines the Migration plugin.

Namespace

Drupal\migrate\Plugin

Code

public function mergeProcessOfProperty($property, array $process_of_property) {

  // If we already have a process value then merge the incoming process array
  // otherwise simply set it.
  $current_process = $this
    ->getProcess();
  if (isset($current_process[$property])) {
    $this->process = NestedArray::mergeDeepArray([
      $current_process,
      $this
        ->getProcessNormalized([
        $property => $process_of_property,
      ]),
    ], TRUE);
  }
  else {
    $this
      ->setProcessOfProperty($property, $process_of_property);
  }
  return $this;
}