X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FQuery%2FSql%2FTables.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FQuery%2FSql%2FTables.php;h=0c54dc45884f494c8e1c101b5021dddfa7951e87;hp=5fff4aa2caac72480c196099e1604fb105943ab0;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php index 5fff4aa2c..0c54dc458 100644 --- a/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php +++ b/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php @@ -8,6 +8,7 @@ use Drupal\Core\Entity\Query\QueryException; use Drupal\Core\Entity\Sql\SqlEntityStorageInterface; use Drupal\Core\Entity\Sql\TableMappingInterface; use Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface; +use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\TypedData\DataReferenceDefinitionInterface; /** @@ -276,14 +277,6 @@ class Tables implements TablesInterface { $entity_type = $this->entityManager->getDefinition($entity_type_id); $field_storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id); // Add the new entity base table using the table and sql column. - // An additional $field_storage argument is being passed to - // addNextBaseTable() in order to improve its functionality, for - // example by allowing extra processing based on the field type of the - // storage. In order to maintain backwards compatibility in 8.4.x, the - // new argument has not been added to the signature of that method, - // and it will be added only in 8.5.x. - // @todo Add the $field_storage argument to addNextBaseTable() in - // 8.5.x. https://www.drupal.org/node/2909425 $base_table = $this->addNextBaseTable($entity_type, $table, $sql_column, $field_storage); $propertyDefinitions = []; $key++; @@ -451,11 +444,13 @@ class Tables implements TablesInterface { * This is the table being joined, in the above example, {users}. * @param string $sql_column * This is the SQL column in the existing table being joined to. + * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage + * The field storage definition for the field referencing this column. * * @return string * The alias of the next entity table joined in. */ - protected function addNextBaseTable(EntityType $entity_type, $table, $sql_column) { + protected function addNextBaseTable(EntityType $entity_type, $table, $sql_column, FieldStorageDefinitionInterface $field_storage) { $join_condition = '%alias.' . $entity_type->getKey('id') . " = $table.$sql_column"; return $this->sqlQuery->leftJoin($entity_type->getBaseTable(), NULL, $join_condition); }