function ProcessPluginBase::transform

Same name and namespace in other branches
  1. 11.x core/modules/migrate/src/ProcessPluginBase.php \Drupal\migrate\ProcessPluginBase::transform()
  2. 10 core/modules/migrate/src/ProcessPluginBase.php \Drupal\migrate\ProcessPluginBase::transform()
  3. 8.9.x core/modules/migrate/src/ProcessPluginBase.php \Drupal\migrate\ProcessPluginBase::transform()
25 methods override ProcessPluginBase::transform()
ContentTranslationEnabledSetting::transform in core/modules/language/src/Plugin/migrate/process/ContentTranslationEnabledSetting.php
Performs the associated process.
FieldBundle::transform in core/modules/field/src/Plugin/migrate/process/d7/FieldBundle.php
Performs the associated process.
FieldFile::transform in core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php
Performs the associated process.
FieldFormatterSettingsDefaults::transform in core/modules/field/src/Plugin/migrate/process/d6/FieldFormatterSettingsDefaults.php
Set field formatter settings when the map didn't map: for date formatters, the fallback format, for everything else, empty array.
FieldInstanceDefaults::transform in core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceDefaults.php
Performs the associated process.

... See full list

File

core/modules/migrate/src/ProcessPluginBase.php, line 36

Class

ProcessPluginBase
The base class for all migrate process plugins.

Namespace

Drupal\migrate

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
  // Do not call this method from children.
  if (isset($this->configuration['method'])) {
    if (method_exists($this, $this->configuration['method'])) {
      return $this->{$this->configuration['method']}($value, $migrate_executable, $row, $destination_property);
    }
    throw new \BadMethodCallException(sprintf('The %s method does not exist in the %s plugin.', $this->configuration['method'], $this->pluginId));
  }
  else {
    throw new \BadMethodCallException(sprintf('The "method" key in the plugin configuration must to be set for the %s plugin.', $this->pluginId));
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.