From edbbe397c138959ccd01614c67148d1db2ee66cb Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 14 Dec 2016 11:24:16 +0000 Subject: [PATCH] Issue #2834445 by claudiu.cristea: Don't fetch the entity type ID on each iteration in SqlContentEntityStorageSchema::getFieldSchemaData() --- .../Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php index f43461ffdd6..61da55f04ff 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -676,13 +676,13 @@ class SqlContentEntityStorageSchema implements DynamicallyFieldableEntityStorage protected function getFieldSchemaData($field_name, array $field_schema, array $column_mapping, $schema_key) { $data = array(); + $entity_type_id = $this->entityType->id(); foreach ($field_schema[$schema_key] as $key => $columns) { // To avoid clashes with entity-level indexes or unique keys we use // "{$entity_type_id}_field__" as a prefix instead of just // "{$entity_type_id}__". We additionally namespace the specifier by the // field name to avoid clashes when multiple fields of the same type are // added to an entity type. - $entity_type_id = $this->entityType->id(); $real_key = $this->getFieldSchemaIdentifierName($entity_type_id, $field_name, $key); foreach ($columns as $column) { // Allow for indexes and unique keys to specified as an array of column