function EntityTestMultiValueBasefield::baseFieldDefinitions

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

Overrides EntityTest::baseFieldDefinitions

File

core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMultiValueBasefield.php, line 32

Class

EntityTestMultiValueBasefield
Defines an entity type with a multivalue base field.

Namespace

Drupal\entity_test\Entity

Code

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);
    $fields['name']->setCardinality(2);
    return $fields;
}

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