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