diff options
| author | polo <ordipolo@gmx.fr> | 2026-10-18 00:08:23 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-10-18 00:10:03 +0200 |
| commit | 05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch) | |
| tree | cf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/doctrine/dbal/src/Platforms/SQLServer/SQL | |
| parent | 32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff) | |
| download | AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2 AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip | |
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/doctrine/dbal/src/Platforms/SQLServer/SQL')
| -rw-r--r-- | vendor/doctrine/dbal/src/Platforms/SQLServer/SQL/Builder/SQLServerSelectSQLBuilder.php | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/vendor/doctrine/dbal/src/Platforms/SQLServer/SQL/Builder/SQLServerSelectSQLBuilder.php b/vendor/doctrine/dbal/src/Platforms/SQLServer/SQL/Builder/SQLServerSelectSQLBuilder.php deleted file mode 100644 index ea6bb60..0000000 --- a/vendor/doctrine/dbal/src/Platforms/SQLServer/SQL/Builder/SQLServerSelectSQLBuilder.php +++ /dev/null | |||
| @@ -1,84 +0,0 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\DBAL\Platforms\SQLServer\SQL\Builder; | ||
| 6 | |||
| 7 | use Doctrine\DBAL\Platforms\SQLServerPlatform; | ||
| 8 | use Doctrine\DBAL\Query\ForUpdate\ConflictResolutionMode; | ||
| 9 | use Doctrine\DBAL\Query\SelectQuery; | ||
| 10 | use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder; | ||
| 11 | |||
| 12 | use function count; | ||
| 13 | use function implode; | ||
| 14 | |||
| 15 | final class SQLServerSelectSQLBuilder implements SelectSQLBuilder | ||
| 16 | { | ||
| 17 | /** @internal The SQL builder should be instantiated only by database platforms. */ | ||
| 18 | public function __construct( | ||
| 19 | private readonly SQLServerPlatform $platform, | ||
| 20 | ) { | ||
| 21 | } | ||
| 22 | |||
| 23 | public function buildSQL(SelectQuery $query): string | ||
| 24 | { | ||
| 25 | $parts = ['SELECT']; | ||
| 26 | |||
| 27 | if ($query->isDistinct()) { | ||
| 28 | $parts[] = 'DISTINCT'; | ||
| 29 | } | ||
| 30 | |||
| 31 | $parts[] = implode(', ', $query->getColumns()); | ||
| 32 | |||
| 33 | $from = $query->getFrom(); | ||
| 34 | |||
| 35 | if (count($from) > 0) { | ||
| 36 | $parts[] = 'FROM ' . implode(', ', $from); | ||
| 37 | } | ||
| 38 | |||
| 39 | $forUpdate = $query->getForUpdate(); | ||
| 40 | |||
| 41 | if ($forUpdate !== null) { | ||
| 42 | $with = ['UPDLOCK', 'ROWLOCK']; | ||
| 43 | |||
| 44 | if ($forUpdate->getConflictResolutionMode() === ConflictResolutionMode::SKIP_LOCKED) { | ||
| 45 | $with[] = 'READPAST'; | ||
| 46 | } | ||
| 47 | |||
| 48 | $parts[] = 'WITH (' . implode(', ', $with) . ')'; | ||
| 49 | } | ||
| 50 | |||
| 51 | $where = $query->getWhere(); | ||
| 52 | |||
| 53 | if ($where !== null) { | ||
| 54 | $parts[] = 'WHERE ' . $where; | ||
| 55 | } | ||
| 56 | |||
| 57 | $groupBy = $query->getGroupBy(); | ||
| 58 | |||
| 59 | if (count($groupBy) > 0) { | ||
| 60 | $parts[] = 'GROUP BY ' . implode(', ', $groupBy); | ||
| 61 | } | ||
| 62 | |||
| 63 | $having = $query->getHaving(); | ||
| 64 | |||
| 65 | if ($having !== null) { | ||
| 66 | $parts[] = 'HAVING ' . $having; | ||
| 67 | } | ||
| 68 | |||
| 69 | $orderBy = $query->getOrderBy(); | ||
| 70 | |||
| 71 | if (count($orderBy) > 0) { | ||
| 72 | $parts[] = 'ORDER BY ' . implode(', ', $orderBy); | ||
| 73 | } | ||
| 74 | |||
| 75 | $sql = implode(' ', $parts); | ||
| 76 | $limit = $query->getLimit(); | ||
| 77 | |||
| 78 | if ($limit->isDefined()) { | ||
| 79 | $sql = $this->platform->modifyLimitQuery($sql, $limit->getMaxResults(), $limit->getFirstResult()); | ||
| 80 | } | ||
| 81 | |||
| 82 | return $sql; | ||
| 83 | } | ||
| 84 | } | ||
