summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2016-12-14 11:24:16 (GMT)
committerAlex Pott2016-12-14 11:24:16 (GMT)
commitedbbe397c138959ccd01614c67148d1db2ee66cb (patch)
tree75b730c422d62a350e626b4526510475a3ef638d
parent230c5bf0e1d8094550acd995b2795dacc46024a5 (diff)
Issue #2834445 by claudiu.cristea: Don't fetch the entity type ID on each iteration in SqlContentEntityStorageSchema::getFieldSchemaData()
-rw-r--r--core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
index f43461f..61da55f 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