interface FieldProcessorInterface

Interface for content entity source field processors.

Hierarchy

Expanded class hierarchy of FieldProcessorInterface

All classes that implement FieldProcessorInterface

File

sources/content/src/FieldProcessorInterface.php, line 12

Namespace

Drupal\tmgmt_content
View source
interface FieldProcessorInterface {

  /**
   * Extracts the translatatable data structure from the given field.
   *
   * @param \Drupal\Core\Field\FieldItemListInterface $field
   *   The field object.
   *
   * @return array $data
   *   An array of elements where each element has the following keys:
   *   - #text
   *   - #translate
   *
   * @see \Drupal\tmgmt_content\Plugin\tmgmt\Source\ContentEntitySource::extractTranslatableData()
   */
  public function extractTranslatableData(FieldItemListInterface $field);

  /**
   * Process the translated data for this field back into a structure that can be saved by the content entity.
   *
   * @param array $field_data
   *   The translated data for this field.
   * @param \Drupal\Core\Field\FieldItemListInterface $field
   *   The field object.
   *
   * @see \Drupal\tmgmt_content\Plugin\tmgmt\Source\ContentEntitySource::doSaveTranslations()
   */
  public function setTranslations($field_data, FieldItemListInterface $field);

}

Members

Namesort descending Modifiers Type Description Overrides
FieldProcessorInterface::extractTranslatableData public function Extracts the translatatable data structure from the given field. 1
FieldProcessorInterface::setTranslations public function Process the translated data for this field back into a structure that can be saved by the content entity. 1