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

Overrides EntityTestMul::baseFieldDefinitions

1 call to EntityTestMulChanged::baseFieldDefinitions()
EntityTestMulRevChanged::baseFieldDefinitions in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php
Provides base field definitions for an entity type.
1 method overrides EntityTestMulChanged::baseFieldDefinitions()
EntityTestMulRevChanged::baseFieldDefinitions in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php
Provides base field definitions for an entity type.

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;
}