You are here

class NullSegmenter in Translation Management Tool 8

Null implementation for the SegmenterInterface.

Hierarchy

Expanded class hierarchy of NullSegmenter

1 string reference to 'NullSegmenter'
tmgmt.services.yml in ./tmgmt.services.yml
tmgmt.services.yml
1 service uses NullSegmenter
tmgmt.segmenter in ./tmgmt.services.yml
Drupal\tmgmt\NullSegmenter

File

src/NullSegmenter.php, line 10

Namespace

Drupal\tmgmt
View source
class NullSegmenter implements SegmenterInterface {

  /**
   * {@inheritdoc}
   */
  public function filterData($segmented_text) {
    return $segmented_text;
  }

  /**
   * {@inheritdoc}
   */
  public function getSegmentsOfData($serialized_data) {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function getSegmentedData($data) {
    return $data;
  }

  /**
   * {@inheritdoc}
   */
  public function validateFormTranslation(FormStateInterface &$form_state, $element, JobItemInterface $job_item) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NullSegmenter::filterData public function Remove the "tmgmt-segment" tags from the data. Overrides SegmenterInterface::filterData
NullSegmenter::getSegmentedData public function Add the segmented data tag to the data or update it. Overrides SegmenterInterface::getSegmentedData
NullSegmenter::getSegmentsOfData public function Returns the segments in the data. Overrides SegmenterInterface::getSegmentsOfData
NullSegmenter::validateFormTranslation public function Validate the segments from the JobItemForm. Overrides SegmenterInterface::validateFormTranslation