You are here

class NoLanguageEntityTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest
  2. 9 core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest

Defines the test entity class.

Plugin annotation


@ContentEntityType(
  id = "no_language_entity_test",
  label = @Translation("Test entity without language support"),
  handlers = {
    "views_data" = "Drupal\entity_test\EntityTestViewsData"
  },
  base_table = "no_language_entity_test",
  persistent_cache = FALSE,
  entity_keys = {
    "id" = "id",
    "uuid" = "uuid",
  },
)

Hierarchy

Expanded class hierarchy of NoLanguageEntityTest

1 file declares its use of NoLanguageEntityTest
ViewNonTranslatableEntityTest.php in core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php

File

core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php, line 26

Namespace

Drupal\language_test\Entity
View source
class NoLanguageEntityTest extends ContentEntityBase {

  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields['id'] = BaseFieldDefinition::create('integer')
      ->setLabel(t('ID'))
      ->setDescription(t('The ID of the test entity.'))
      ->setReadOnly(TRUE)
      ->setSetting('unsigned', TRUE);
    $fields['uuid'] = BaseFieldDefinition::create('uuid')
      ->setLabel(t('UUID'))
      ->setDescription(t('The UUID of the test entity.'))
      ->setReadOnly(TRUE);
    return $fields;
  }

}

Members