Commit edbbe397 authored by alexpott's avatar alexpott

Issue #2834445 by claudiu.cristea: Don't fetch the entity type ID on each...

Issue #2834445 by claudiu.cristea: Don't fetch the entity type ID on each iteration in SqlContentEntityStorageSchema::getFieldSchemaData()
parent 230c5bf0
......@@ -676,13 +676,13 @@ protected function getFieldUniqueKeys($field_name, array $field_schema, array $c
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
......
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