function DefaultValue::transform
Same name in other branches
- 9 core/modules/migrate/src/Plugin/migrate/process/DefaultValue.php \Drupal\migrate\Plugin\migrate\process\DefaultValue::transform()
- 10 core/modules/migrate/src/Plugin/migrate/process/DefaultValue.php \Drupal\migrate\Plugin\migrate\process\DefaultValue::transform()
- 11.x core/modules/migrate/src/Plugin/migrate/process/DefaultValue.php \Drupal\migrate\Plugin\migrate\process\DefaultValue::transform()
Overrides ProcessPluginBase::transform
File
-
core/
modules/ migrate/ src/ Plugin/ migrate/ process/ DefaultValue.php, line 53
Class
- DefaultValue
- Returns a given default value if the input is empty.
Namespace
Drupal\migrate\Plugin\migrate\processCode
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if (!empty($this->configuration['strict'])) {
return isset($value) ? $value : $this->configuration['default_value'];
}
return $value ?: $this->configuration['default_value'];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.