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/Schema/Sequence.php | |
| 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/Schema/Sequence.php')
| -rw-r--r-- | vendor/doctrine/dbal/src/Schema/Sequence.php | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/vendor/doctrine/dbal/src/Schema/Sequence.php b/vendor/doctrine/dbal/src/Schema/Sequence.php deleted file mode 100644 index 32a5e67..0000000 --- a/vendor/doctrine/dbal/src/Schema/Sequence.php +++ /dev/null | |||
| @@ -1,98 +0,0 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\DBAL\Schema; | ||
| 6 | |||
| 7 | use function count; | ||
| 8 | use function sprintf; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * Sequence structure. | ||
| 12 | */ | ||
| 13 | class Sequence extends AbstractAsset | ||
| 14 | { | ||
| 15 | protected int $allocationSize = 1; | ||
| 16 | |||
| 17 | protected int $initialValue = 1; | ||
| 18 | |||
| 19 | public function __construct( | ||
| 20 | string $name, | ||
| 21 | int $allocationSize = 1, | ||
| 22 | int $initialValue = 1, | ||
| 23 | protected ?int $cache = null, | ||
| 24 | ) { | ||
| 25 | $this->_setName($name); | ||
| 26 | $this->setAllocationSize($allocationSize); | ||
| 27 | $this->setInitialValue($initialValue); | ||
| 28 | } | ||
| 29 | |||
| 30 | public function getAllocationSize(): int | ||
| 31 | { | ||
| 32 | return $this->allocationSize; | ||
| 33 | } | ||
| 34 | |||
| 35 | public function getInitialValue(): int | ||
| 36 | { | ||
| 37 | return $this->initialValue; | ||
| 38 | } | ||
| 39 | |||
| 40 | public function getCache(): ?int | ||
| 41 | { | ||
| 42 | return $this->cache; | ||
| 43 | } | ||
| 44 | |||
| 45 | public function setAllocationSize(int $allocationSize): self | ||
| 46 | { | ||
| 47 | $this->allocationSize = $allocationSize; | ||
| 48 | |||
| 49 | return $this; | ||
| 50 | } | ||
| 51 | |||
| 52 | public function setInitialValue(int $initialValue): self | ||
| 53 | { | ||
| 54 | $this->initialValue = $initialValue; | ||
| 55 | |||
| 56 | return $this; | ||
| 57 | } | ||
| 58 | |||
| 59 | public function setCache(int $cache): self | ||
| 60 | { | ||
| 61 | $this->cache = $cache; | ||
| 62 | |||
| 63 | return $this; | ||
| 64 | } | ||
| 65 | |||
| 66 | /** | ||
| 67 | * Checks if this sequence is an autoincrement sequence for a given table. | ||
| 68 | * | ||
| 69 | * This is used inside the comparator to not report sequences as missing, | ||
| 70 | * when the "from" schema implicitly creates the sequences. | ||
| 71 | */ | ||
| 72 | public function isAutoIncrementsFor(Table $table): bool | ||
| 73 | { | ||
| 74 | $primaryKey = $table->getPrimaryKey(); | ||
| 75 | |||
| 76 | if ($primaryKey === null) { | ||
| 77 | return false; | ||
| 78 | } | ||
| 79 | |||
| 80 | $pkColumns = $primaryKey->getColumns(); | ||
| 81 | |||
| 82 | if (count($pkColumns) !== 1) { | ||
| 83 | return false; | ||
| 84 | } | ||
| 85 | |||
| 86 | $column = $table->getColumn($pkColumns[0]); | ||
| 87 | |||
| 88 | if (! $column->getAutoincrement()) { | ||
| 89 | return false; | ||
| 90 | } | ||
| 91 | |||
| 92 | $sequenceName = $this->getShortestName($table->getNamespaceName()); | ||
| 93 | $tableName = $table->getShortestName($table->getNamespaceName()); | ||
| 94 | $tableSequenceName = sprintf('%s_%s_seq', $tableName, $column->getShortestName($table->getNamespaceName())); | ||
| 95 | |||
| 96 | return $tableSequenceName === $sequenceName; | ||
| 97 | } | ||
| 98 | } | ||
