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

Overrides RevisionableContentEntityBase::baseFieldDefinitions

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

File

core/modules/system/tests/modules/entity_test_revlog/src/Entity/EntityTestWithRevisionLog.php, line 60

Class

EntityTestWithRevisionLog
Defines the test entity class.

Namespace

Drupal\entity_test_revlog\Entity

Code

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
  $fields = parent::baseFieldDefinitions($entity_type);
  $fields['name'] = BaseFieldDefinition::create('string')
    ->setLabel(t('Name'))
    ->setDescription(t('The name of the test entity.'))
    ->setRevisionable(TRUE)
    ->setSetting('max_length', 64)
    ->setDisplayOptions('view', [
    'label' => 'hidden',
    'type' => 'string',
    'weight' => -5,
  ])
    ->setDisplayOptions('form', [
    'type' => 'string_textfield',
    'weight' => -5,
  ]);
  return $fields;
}