public static function LingotekContentMetadata::baseFieldDefinitions in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 8.2 src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 4.0.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 3.0.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 3.1.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 3.2.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 3.3.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 3.4.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 3.5.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 3.6.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
- 3.7.x src/Entity/LingotekContentMetadata.php \Drupal\lingotek\Entity\LingotekContentMetadata::baseFieldDefinitions()
inheritdoc}
Overrides ContentEntityBase::baseFieldDefinitions
File
- src/
Entity/ LingotekContentMetadata.php, line 36
Class
- LingotekContentMetadata
- Defines the Lingotek content metadata entity.
Namespace
Drupal\lingotek\EntityCode
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
$fields['content_entity_type_id'] = BaseFieldDefinition::create('string')
->setLabel(new TranslatableMarkup('Content entity type ID'))
->setDescription(new TranslatableMarkup('The ID of the content entity type this Lingotek status is for.'))
->setRequired(TRUE);
$fields['content_entity_id'] = BaseFieldDefinition::create('integer')
->setLabel(new TranslatableMarkup('Content entity ID'))
->setDescription(new TranslatableMarkup('The ID of the content entity this Lingotek status is for.'))
->setRequired(TRUE);
$fields['document_id'] = BaseFieldDefinition::create('string')
->setLabel(new TranslatableMarkup('Lingotek document id'))
->setDescription(new TranslatableMarkup('The Lingotek document id.'));
$fields['hash'] = BaseFieldDefinition::create('string')
->setLabel(new TranslatableMarkup('Lingotek hash'))
->setDescription(new TranslatableMarkup('A hash of the Lingotek saved entity data, required for checking for changes.'));
$fields['profile'] = BaseFieldDefinition::create('entity_reference')
->setLabel(new TranslatableMarkup('Lingotek profile'))
->setDescription(new TranslatableMarkup('The Lingotek profile defining this translation.'))
->setSetting('target_type', 'lingotek_profile');
$fields['translation_source'] = BaseFieldDefinition::create('language')
->setComputed(TRUE)
->setClass(LingotekTranslationSourceField::class)
->setLabel(new TranslatableMarkup('Lingotek translation source'))
->setDescription(new TranslatableMarkup('The source language from which this translation was created.'))
->setDefaultValue(LanguageInterface::LANGCODE_NOT_SPECIFIED)
->setTranslatable(TRUE);
$fields['translation_status'] = BaseFieldDefinition::create('lingotek_language_key_value')
->setLabel(new TranslatableMarkup('Lingotek translation status'))
->setDescription(new TranslatableMarkup('The status of the source in case of being the source translation, or the status of the translation.'))
->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
$fields['job_id'] = BaseFieldDefinition::create('string')
->setLabel(new TranslatableMarkup('Lingotek job id'))
->setDescription(new TranslatableMarkup('The Lingotek job id.'));
$fields['updated_timestamp'] = BaseFieldDefinition::create('timestamp')
->setLabel(new TranslatableMarkup('Updated timestamp'))
->setDescription(new TranslatableMarkup('The last time document was updated.'));
$fields['uploaded_timestamp'] = BaseFieldDefinition::create('timestamp')
->setLabel(new TranslatableMarkup('Initial upload'))
->setDescription(new TranslatableMarkup('The time of the initial upload.'));
return $fields;
}