You are here

public function Migration::mergeProcessOfProperty in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/src/Entity/Migration.php \Drupal\migrate\Entity\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/Entity/Migration.php, line 520
Contains \Drupal\migrate\Entity\Migration.

Class

Migration
Defines the Migration entity.

Namespace

Drupal\migrate\Entity

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;
}