From 4f7e243beee4ef23a63266bb2268622765e7c7c2 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 29 Nov 2021 15:28:40 +0000 Subject: [PATCH] [CORE][DB] Don't do column renaming if a list of entities is specified --- src/Core/DB/DB.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/DB/DB.php b/src/Core/DB/DB.php index e07956fd6b..a51c158c16 100644 --- a/src/Core/DB/DB.php +++ b/src/Core/DB/DB.php @@ -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);