throw new QueryException("No base table for " .
$this->entityTypeId . ", invalid query."
);
} } $simple_query = TRUE;
if ($this->entityType->
getDataTable()) { $simple_query = FALSE;
} $this->sqlQuery =
$this->connection->
select($base_table, 'base_table',
['conjunction' =>
$this->conjunction
]);
// Reset the tables structure, as it might have been built for a previous
// execution of this query.
$this->tables = NULL;
$this->sqlQuery->
addMetaData('entity_type',
$this->entityTypeId
);
$id_field =
$this->entityType->
getKey('id'
);
// Add the key field for fetchAllKeyed().
if (!
$revision_field =
$this->entityType->
getKey('revision'
)) { // When there is no revision support, the key field is the entity key.
$this->sqlFields
["base_table.
$id_field"
] =
['base_table',
$id_field];
// Now add the value column for fetchAllKeyed(). This is always the
// entity id.
$this->sqlFields
["base_table.
$id_field" . '_1'
] =
['base_table',
$id_field];
} else { // When there is revision support, the key field is the revision key.