function ProcessField::transform
Overrides ProcessPluginBase::transform
File
-
core/
modules/ field/ src/ Plugin/ migrate/ process/ ProcessField.php, line 94
Class
- ProcessField
- Get the value from a method call on a field plugin instance.
Namespace
Drupal\field\Plugin\migrate\processCode
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if (!is_string($value)) {
throw new MigrateException('The input value must be a string.');
}
if (empty($this->configuration['method'])) {
throw new MigrateException('You need to specify the name of a method to be called on the Field plugin.');
}
$method = $this->configuration['method'];
try {
return $this->callMethodOnFieldPlugin($this->fieldPluginManager, $value, $method, $row);
} catch (PluginNotFoundException) {
return NULL;
}
}