function EntityTestMulChanged::baseFieldDefinitions

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php \Drupal\entity_test\Entity\EntityTestMulChanged::baseFieldDefinitions()
  2. 10 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php \Drupal\entity_test\Entity\EntityTestMulChanged::baseFieldDefinitions()

File

core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php, line 54

Class

EntityTestMulChanged
Defines the test entity class.

Namespace

Drupal\entity_test\Entity

Code

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
  $fields = parent::baseFieldDefinitions($entity_type);
  $fields['changed'] = BaseFieldDefinition::create('changed_test')->setLabel(t('Changed'))
    ->setDescription(t('The time that the entity was last edited.'))
    ->setTranslatable(TRUE);
  $fields['not_translatable'] = BaseFieldDefinition::create('string')->setLabel(t('Non translatable'))
    ->setDescription(t('A non-translatable string field'));
  return $fields;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.