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

Overrides EntityTest::baseFieldDefinitions

2 calls to EntityTestRev::baseFieldDefinitions()
EntityTestMulRev::baseFieldDefinitions in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php
Provides base field definitions for an entity type.
EntityTestRevPub::baseFieldDefinitions in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRevPub.php
Provides base field definitions for an entity type.
2 methods override EntityTestRev::baseFieldDefinitions()
EntityTestMulRev::baseFieldDefinitions in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php
Provides base field definitions for an entity type.
EntityTestRevPub::baseFieldDefinitions in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRevPub.php
Provides base field definitions for an entity type.

File

core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php, line 60

Class

EntityTestRev
Defines the test entity class.

Namespace

Drupal\entity_test\Entity

Code

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
  $fields = parent::baseFieldDefinitions($entity_type);
  $fields['name']
    ->setRevisionable(TRUE);
  $fields['user_id']
    ->setRevisionable(TRUE);
  $fields['non_rev_field'] = BaseFieldDefinition::create('string')
    ->setLabel(t('Non Revisionable Field'))
    ->setDescription(t('A non-revisionable test field.'))
    ->setRevisionable(FALSE)
    ->setTranslatable(TRUE)
    ->setCardinality(1)
    ->setReadOnly(TRUE);
  return $fields;
}