class LinkFieldProcessor

Field processor for the link field.

Hierarchy

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_content
View 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

Namesort descending Modifiers Type Description Overrides
DefaultFieldProcessor::handleFormat protected function Handles adjusting the field item data if a format was detected.
DefaultFieldProcessor::setTranslations public function Process the translated data for this field back into a structure that can be saved by the content entity. Overrides FieldProcessorInterface::setTranslations 1
DefaultFieldProcessor::shouldTranslateProperty protected function Returns whether the property should be translated or not.
LinkFieldProcessor::extractTranslatableData public function Extracts the translatatable data structure from the given field. Overrides DefaultFieldProcessor::extractTranslatableData