function StringIdEntityTest::baseFieldDefinitions

Same name in other branches
  1. 9 core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php \Drupal\migrate_entity_test\Entity\StringIdEntityTest::baseFieldDefinitions()
  2. 8.9.x core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php \Drupal\migrate_entity_test\Entity\StringIdEntityTest::baseFieldDefinitions()
  3. 11.x core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php \Drupal\migrate_entity_test\Entity\StringIdEntityTest::baseFieldDefinitions()

Overrides ContentEntityBase::baseFieldDefinitions

File

core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php, line 26

Class

StringIdEntityTest
Defines a content entity type that has a string ID.

Namespace

Drupal\migrate_entity_test\Entity

Code

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    return [
        'id' => BaseFieldDefinition::create('integer')->setSetting('size', 'big')
            ->setLabel('ID'),
        'version' => BaseFieldDefinition::create('string')->setLabel('Version'),
    ];
}

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