class NoLanguageEntityTest

Same name and namespace in other branches
  1. 10 core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest
  2. 11.x core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php \Drupal\language_test\Entity\NoLanguageEntityTest
  3. 8.9.x 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;
  }

}

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