protected function LingotekTranslationSourceField::computeValue in Lingotek Translation 3.0.x
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 4.0.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 3.1.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 3.2.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 3.3.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 3.4.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 3.5.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 3.6.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 3.7.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
- 3.8.x src/Plugin/Field/FieldType/LingotekTranslationSourceField.php \Drupal\lingotek\Plugin\Field\FieldType\LingotekTranslationSourceField::computeValue()
Compute the values.
Overrides ComputedItemListTrait::computeValue
File
- src/
Plugin/ Field/ FieldType/ LingotekTranslationSourceField.php, line 16
Class
Namespace
Drupal\lingotek\Plugin\Field\FieldTypeCode
protected function computeValue() {
$metadata = $this
->getEntity();
$entity_type_id = $metadata
->getContentEntityTypeId();
$entity_id = $metadata
->getContentEntityId();
if ($entity_type_id && $entity_id) {
$target_entity = \Drupal::entityTypeManager()
->getStorage($entity_type_id)
->load($entity_id);
if ($target_entity) {
$this->list[0] = $this
->createItem(0, $target_entity
->language()
->getId());
}
}
}