[CORE][DB] Don't do column renaming if a list of entities is specified

This commit is contained in:
Hugo Sales 2021-11-29 15:28:40 +00:00 committed by Diogo Peralta Cordeiro
parent ed5f6b6eed
commit 4f7e243bee
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ class DB
if ($_ENV['APP_ENV'] === 'dev' && str_starts_with($query, 'select *')) {
throw new Exception('Cannot use `select *`, use `select {select}` (see ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT)');
}
$rsmb = new ResultSetMappingBuilder(self::$em, ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT);
$rsmb = new ResultSetMappingBuilder(self::$em, \is_null($entities) ? ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT : ResultSetMappingBuilder::COLUMN_RENAMING_NONE);
if (\is_null($entities)) {
$matches = [];
preg_match_all(self::$table_entity_pattern, $query, $matches);