summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Internal/SQLResultCasing.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/orm/src/Internal/SQLResultCasing.php')
-rw-r--r--vendor/doctrine/orm/src/Internal/SQLResultCasing.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Internal/SQLResultCasing.php b/vendor/doctrine/orm/src/Internal/SQLResultCasing.php
new file mode 100644
index 0000000..53b412e
--- /dev/null
+++ b/vendor/doctrine/orm/src/Internal/SQLResultCasing.php
@@ -0,0 +1,30 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Internal;
6
7use Doctrine\DBAL\Platforms\AbstractPlatform;
8use Doctrine\DBAL\Platforms\DB2Platform;
9use Doctrine\DBAL\Platforms\OraclePlatform;
10use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
11
12use function strtolower;
13use function strtoupper;
14
15/** @internal */
16trait SQLResultCasing
17{
18 private function getSQLResultCasing(AbstractPlatform $platform, string $column): string
19 {
20 if ($platform instanceof DB2Platform || $platform instanceof OraclePlatform) {
21 return strtoupper($column);
22 }
23
24 if ($platform instanceof PostgreSQLPlatform) {
25 return strtolower($column);
26 }
27
28 return $column;
29 }
30}