Commit 1364bb63 authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #2884894 by amateescu, tstoeckler: Remove obsolete + duplicate EntityTestUpdate class

parent fb746e5f
......@@ -161,15 +161,6 @@ function entity_test_entity_base_field_info_alter(&$fields, EntityTypeInterface
}
}
/**
* Implements hook_entity_field_storage_info().
*/
function entity_test_entity_field_storage_info(EntityTypeInterface $entity_type) {
if ($entity_type->id() == 'entity_test_update') {
return \Drupal::state()->get('entity_test_update.additional_field_storage_definitions', []);
}
}
/**
* Creates a new bundle for entity_test entities.
*
......
<?php
namespace Drupal\entity_test\Entity;
use Drupal\Core\Entity\EntityTypeInterface;
/**
* Defines the test entity class for testing definition updates.
*
* This entity type starts out non-revisionable by lacking a "revision_id" key,
* but during an update test, can be made revisionable by adding that key.
*
* @ContentEntityType(
* id = "entity_test_update",
* label = @Translation("Test entity update"),
* handlers = {
* "storage_schema" = "Drupal\entity_test\EntityTestStorageSchema"
* },
* base_table = "entity_test_update",
* revision_table = "entity_test_update_revision",
* persistent_cache = FALSE,
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid",
* "bundle" = "type",
* "label" = "name",
* "langcode" = "langcode",
* }
* )
*/
class EntityTestUpdate extends EntityTestRev {
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
$fields += \Drupal::state()->get('entity_test_update.additional_base_field_definitions', []);
return $fields;
}
/**
* {@inheritdoc}
*/
public static function bundleFieldDefinitions(EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
$fields = parent::bundleFieldDefinitions($entity_type, $bundle, $base_field_definitions);
$fields += \Drupal::state()->get('entity_test_update.additional_bundle_field_definitions.' . $bundle, []);
return $fields;
}
}
......@@ -29,6 +29,15 @@ function entity_test_update_entity_base_field_info(EntityTypeInterface $entity_t
}
}
/**
* Implements hook_entity_field_storage_info().
*/
function entity_test_update_entity_field_storage_info(EntityTypeInterface $entity_type) {
if ($entity_type->id() == 'entity_test_update') {
return \Drupal::state()->get('entity_test_update.additional_field_storage_definitions', []);
}
}
/**
* Implements hook_entity_type_alter().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment