$tableName =
$this->quoteStrategy->
getTableName($versionedClass,
$this->platform
);
$identifier =
$this->quoteStrategy->
getIdentifierColumnNames($versionedClass,
$this->platform
);
// FIXME: Order with composite keys might not be correct
$sql = 'SELECT ' .
implode(', ',
$columnNames) . ' FROM ' .
$tableName . ' WHERE ' .
implode(' = ? AND ',
$identifier) . ' = ?';
$flatId =
$this->identifierFlattener->
flattenIdentifier($versionedClass,
$id);
$values =
$this->conn->
fetchNumeric( $sql,
array_values($flatId),
$this->
extractIdentifierTypes($id,
$versionedClass) );
if ($values === false
) { throw new LengthException('Unexpected empty result for database query.'
);
} $values =
array_combine(array_keys($columnNames),
$values);