diff options
Diffstat (limited to 'vendor/doctrine/orm/src/Internal/SQLResultCasing.php')
| -rw-r--r-- | vendor/doctrine/orm/src/Internal/SQLResultCasing.php | 30 |
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 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Internal; | ||
| 6 | |||
| 7 | use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
| 8 | use Doctrine\DBAL\Platforms\DB2Platform; | ||
| 9 | use Doctrine\DBAL\Platforms\OraclePlatform; | ||
| 10 | use Doctrine\DBAL\Platforms\PostgreSQLPlatform; | ||
| 11 | |||
| 12 | use function strtolower; | ||
| 13 | use function strtoupper; | ||
| 14 | |||
| 15 | /** @internal */ | ||
| 16 | trait 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 | } | ||
