class LinkFieldProcessor in Translation Management Tool 8
Field processor for the link field.
Hierarchy
- class \Drupal\tmgmt_content\DefaultFieldProcessor implements FieldProcessorInterface
- class \Drupal\tmgmt_content\LinkFieldProcessor
Expanded class hierarchy of LinkFieldProcessor
1 file declares its use of LinkFieldProcessor
- tmgmt_content.module in sources/
content/ tmgmt_content.module - Source plugin for the Translation Management system that handles entities.
File
- sources/
content/ src/ LinkFieldProcessor.php, line 11
Namespace
Drupal\tmgmt_contentView source
class LinkFieldProcessor extends DefaultFieldProcessor {
/**
* {@inheritdoc}
*/
public function extractTranslatableData(FieldItemListInterface $field) {
$data = parent::extractTranslatableData($field);
foreach (Element::children($data) as $key) {
if (!empty($data[$key]['uri']['#translate'])) {
$data[$key]['uri']['#translate'] = FALSE;
}
}
return $data;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultFieldProcessor:: |
protected | function | Handles adjusting the field item data if a format was detected. | |
DefaultFieldProcessor:: |
public | function |
Process the translated data for this field back into a structure that can be saved by the content entity. Overrides FieldProcessorInterface:: |
1 |
DefaultFieldProcessor:: |
protected | function | Returns whether the property should be translated or not. | |
LinkFieldProcessor:: |
public | function |
Extracts the translatatable data structure from the given field. Overrides DefaultFieldProcessor:: |