function EntitySerializedField::baseFieldDefinitions

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

Overrides EntityTest::baseFieldDefinitions

File

core/modules/system/tests/modules/entity_test/src/Entity/EntitySerializedField.php, line 36

Class

EntitySerializedField
Defines a test class for testing fields with a serialized column.

Namespace

Drupal\entity_test\Entity

Code

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);
    $fields['serialized'] = BaseFieldDefinition::create('serialized_item_test')->setLabel(t('Serialized'));
    $fields['serialized_text'] = BaseFieldDefinition::create('serialized_property_item_test')->setLabel(t('Serialized text'));
    $fields['serialized_long'] = BaseFieldDefinition::create('string_long')->setLabel(t('Serialized long string'));
    return $fields;
}

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