function TextField::getFieldWidgetType
Same name in other branches
- 9 core/modules/text/src/Plugin/migrate/field/d7/TextField.php \Drupal\text\Plugin\migrate\field\d7\TextField::getFieldWidgetType()
- 8.9.x core/modules/text/src/Plugin/migrate/field/d7/TextField.php \Drupal\text\Plugin\migrate\field\d7\TextField::getFieldWidgetType()
- 11.x core/modules/text/src/Plugin/migrate/field/d7/TextField.php \Drupal\text\Plugin\migrate\field\d7\TextField::getFieldWidgetType()
Overrides FieldPluginBase::getFieldWidgetType
File
-
core/
modules/ text/ src/ Plugin/ migrate/ field/ d7/ TextField.php, line 46
Class
Namespace
Drupal\text\Plugin\migrate\field\d7Code
public function getFieldWidgetType(Row $row) {
$field_type = $this->getFieldType($row);
$widget_type = $row->getSourceProperty('widget/type');
switch ($field_type) {
case 'string':
$widget_type = str_replace('text_textfield', 'string_textfield', $widget_type);
break;
case 'string_long':
$widget_type = str_replace('text_textarea', 'string_textarea', $widget_type);
break;
}
return $widget_type;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.