diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php index 5f63b65..dbb5ddd 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php @@ -209,21 +209,21 @@ protected function mapFromStorageRecords(array $records, $load_revision = FALSE) /** * Attaches property data in all languages for translatable properties. * - * @param array $queried_entities - * Associative array of entities, keyed on the entity ID. + * @param array $records + * Associative array of entity records, keyed on the entity ID. * @param boolean $load_revision * (optional) TRUE if the revision should be loaded, defaults to FALSE. */ - protected function attachPropertyData(&$queried_entities, $load_revision = FALSE) { + protected function attachPropertyData(&$records, $load_revision = FALSE) { if ($this->dataTable) { $query = db_select($this->dataTable, 'data', array('fetch' => PDO::FETCH_ASSOC)) ->fields('data') - ->condition($this->idKey, array_keys($queried_entities)) + ->condition($this->idKey, array_keys($records)) ->orderBy('data.' . $this->idKey); if ($load_revision) { // Get revision ID's. $revision_ids = array(); - foreach ($queried_entities as $id => $entity) { + foreach ($records as $id => $entity) { $revision_ids[] = $entity->get($this->revisionKey)->value; } $query->condition($this->revisionKey, $revision_ids); @@ -237,10 +237,7 @@ protected function attachPropertyData(&$queried_entities, $load_revision = FALSE $langcode = empty($values['default_langcode']) ? $values['langcode'] : LANGUAGE_DEFAULT; foreach ($this->entityInfo['schema_fields_sql']['data_table'] as $name) { - // @todo Use EntityInterface::set() here to skip magic methods and - // improve readability as soon as the Field API is converted to the - // Entity Field API. - $queried_entities[$id]->{$name}[$langcode][0]['value'] = $values[$name]; + $records[$id]->{$name}[$langcode][0]['value'] = $values[$name]; } } }