You are here

public static function NoLanguageEntityTest::baseFieldDefinitions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest::baseFieldDefinitions()
  2. 9 core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest::baseFieldDefinitions()

File

core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php, line 31

Class

NoLanguageEntityTest
Defines the test entity class.

Namespace

Drupal\language_test\Entity

Code

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
  $fields['id'] = BaseFieldDefinition::create('integer')
    ->setLabel(t('ID'))
    ->setDescription(t('The ID of the test entity.'))
    ->setReadOnly(TRUE)
    ->setSetting('unsigned', TRUE);
  $fields['uuid'] = BaseFieldDefinition::create('uuid')
    ->setLabel(t('UUID'))
    ->setDescription(t('The UUID of the test entity.'))
    ->setReadOnly(TRUE);
  return $fields;
}