function NoLanguageEntityTest::baseFieldDefinitions

Same name in other branches
  1. 8.9.x core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest::baseFieldDefinitions()
  2. 10 core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest::baseFieldDefinitions()
  3. 11.x core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest::baseFieldDefinitions()

Overrides ContentEntityBase::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;
}

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