Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Get.php

function Get::transform

Overrides ProcessPluginBase::transform

File

core/modules/migrate/src/Plugin/migrate/process/Get.php, line 107

Class

Get
Gets the source value.

Namespace

Drupal\migrate\Plugin\migrate\process

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    $source = $this->configuration['source'];
    $properties = is_string($source) ? [
        $source,
    ] : $source;
    $return = [];
    foreach ($properties as $property) {
        if ($property || (string) $property === '0') {
            $return[] = $row->get($property);
        }
        else {
            $return[] = $value;
        }
    }
    if (is_string($source)) {
        $this->multiple = is_array($return[0]);
        return $return[0];
    }
    return $return;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal