class EntityTestFieldMethods

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestFieldMethods.php \Drupal\entity_test\Entity\EntityTestFieldMethods

Defines the test entity class.

Plugin annotation


@ContentEntityType(
  id = "entity_test_field_methods",
  label = @Translation("Test entity - data table"),
  handlers = {
    "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
    "access" = "Drupal\entity_test\EntityTestAccessControlHandler",
    "form" = {
      "default" = "Drupal\entity_test\EntityTestForm",
      "delete" = "Drupal\entity_test\EntityTestDeleteForm"
    },
    "views_data" = "Drupal\views\EntityViewsData",
    "route_provider" = {
      "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
    },
  },
  base_table = "entity_test_field_methods",
  data_table = "entity_test_field_methods_property",
  admin_permission = "administer entity_test content",
  translatable = TRUE,
  entity_keys = {
    "id" = "id",
    "uuid" = "uuid",
    "bundle" = "type",
    "label" = "name",
    "langcode" = "langcode",
  },
)

Hierarchy

Expanded class hierarchy of EntityTestFieldMethods

File

core/modules/system/tests/modules/entity_test/src/Entity/EntityTestFieldMethods.php, line 39

Namespace

Drupal\entity_test\Entity
View source
class EntityTestFieldMethods extends EntityTestMul {
  
  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);
    $fields['test_invocation_order'] = BaseFieldDefinition::create('auto_incrementing_test')->setLabel(t('Test field method invocation order.'))
      ->setTranslatable(TRUE);
    return $fields;
  }

}

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