class EntityTestMapField

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMapField.php \Drupal\entity_test\Entity\EntityTestMapField
  2. 10 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMapField.php \Drupal\entity_test\Entity\EntityTestMapField
  3. 8.9.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMapField.php \Drupal\entity_test\Entity\EntityTestMapField

An entity used for testing map base field values.

Plugin annotation


@ContentEntityType(
  id = "entity_test_map_field",
  label = @Translation("Entity Test map field"),
  base_table = "entity_test_map_field",
  entity_keys = {
    "uuid" = "uuid",
    "id" = "id",
    "label" = "name",
    "langcode" = "langcode",
  },
  admin_permission = "administer entity_test content",
)

Hierarchy

Expanded class hierarchy of EntityTestMapField

3 files declare their use of EntityTestMapField
EntityTestMapFieldResourceTestBase.php in core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestMapFieldResourceTestBase.php
EntityTestMapFieldTest.php in core/modules/jsonapi/tests/src/Functional/EntityTestMapFieldTest.php
JsonApiRegressionTest.php in core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php

File

core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMapField.php, line 24

Namespace

Drupal\entity_test\Entity
View source
class EntityTestMapField extends EntityTest {
  
  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);
    $fields['data'] = BaseFieldDefinition::create('map')->setLabel(t('Data'))
      ->setDescription(t('A serialized array of additional data.'));
    return $fields;
  }

}

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