@@ -61,10 +61,7 @@ class Table extends AbstractAsset
61
61
'create_options ' => [],
62
62
];
63
63
64
- /** @deprecated Pass a {@link TableConfiguration} instance to the constructor instead. */
65
- protected ?SchemaConfig $ _schemaConfig = null ;
66
-
67
- private int $ maxIdentifierLength ;
64
+ private readonly int $ maxIdentifierLength ;
68
65
69
66
/**
70
67
* @param array<Column> $columns
@@ -111,21 +108,6 @@ public function __construct(
111
108
$ this ->_options = array_merge ($ this ->_options , $ options );
112
109
}
113
110
114
- /** @deprecated Pass a {@link TableConfiguration} instance to the constructor instead. */
115
- public function setSchemaConfig (SchemaConfig $ schemaConfig ): void
116
- {
117
- Deprecation::triggerIfCalledFromOutside (
118
- 'doctrine/dbal ' ,
119
- 'https://github.com/doctrine/dbal/pull/6635 ' ,
120
- '%s is deprecated. Pass TableConfiguration to the constructor instead. ' ,
121
- __METHOD__ ,
122
- );
123
-
124
- $ this ->_schemaConfig = $ schemaConfig ;
125
-
126
- $ this ->maxIdentifierLength = $ schemaConfig ->getMaxIdentifierLength ();
127
- }
128
-
129
111
/**
130
112
* Sets the Primary Key.
131
113
*
@@ -161,7 +143,7 @@ public function addUniqueConstraint(
161
143
$ indexName ??= $ this ->_generateIdentifierName (
162
144
array_merge ([$ this ->getName ()], $ columnNames ),
163
145
'uniq ' ,
164
- $ this ->_getMaxIdentifierLength () ,
146
+ $ this ->maxIdentifierLength ,
165
147
);
166
148
167
149
return $ this ->_addUniqueConstraint ($ this ->_createUniqueConstraint ($ columnNames , $ indexName , $ flags , $ options ));
@@ -181,7 +163,7 @@ public function addIndex(
181
163
$ indexName ??= $ this ->_generateIdentifierName (
182
164
array_merge ([$ this ->getName ()], $ columnNames ),
183
165
'idx ' ,
184
- $ this ->_getMaxIdentifierLength () ,
166
+ $ this ->maxIdentifierLength ,
185
167
);
186
168
187
169
return $ this ->_addIndex ($ this ->_createIndex ($ columnNames , $ indexName , false , false , $ flags , $ options ));
@@ -223,7 +205,7 @@ public function addUniqueIndex(array $columnNames, ?string $indexName = null, ar
223
205
$ indexName ??= $ this ->_generateIdentifierName (
224
206
array_merge ([$ this ->getName ()], $ columnNames ),
225
207
'uniq ' ,
226
- $ this ->_getMaxIdentifierLength () ,
208
+ $ this ->maxIdentifierLength ,
227
209
);
228
210
229
211
return $ this ->_addIndex ($ this ->_createIndex ($ columnNames , $ indexName , true , false , [], $ options ));
@@ -408,7 +390,7 @@ public function addForeignKeyConstraint(
408
390
$ name ??= $ this ->_generateIdentifierName (
409
391
array_merge ([$ this ->getName ()], $ localColumnNames ),
410
392
'fk ' ,
411
- $ this ->_getMaxIdentifierLength () ,
393
+ $ this ->maxIdentifierLength ,
412
394
);
413
395
414
396
foreach ($ localColumnNames as $ columnName ) {
@@ -641,19 +623,6 @@ public function __clone()
641
623
}
642
624
}
643
625
644
- /** @deprecated */
645
- protected function _getMaxIdentifierLength (): int
646
- {
647
- Deprecation::triggerIfCalledFromOutside (
648
- 'doctrine/dbal ' ,
649
- 'https://github.com/doctrine/dbal/pull/6635 ' ,
650
- '%s is deprecated. ' ,
651
- __METHOD__ ,
652
- );
653
-
654
- return $ this ->maxIdentifierLength ;
655
- }
656
-
657
626
protected function _addColumn (Column $ column ): void
658
627
{
659
628
$ columnName = $ column ->getName ();
@@ -715,7 +684,7 @@ protected function _addUniqueConstraint(UniqueConstraint $constraint): self
715
684
: $ this ->_generateIdentifierName (
716
685
array_merge ((array ) $ this ->getName (), $ constraint ->getColumns ()),
717
686
'fk ' ,
718
- $ this ->_getMaxIdentifierLength () ,
687
+ $ this ->maxIdentifierLength ,
719
688
);
720
689
721
690
$ name = $ this ->normalizeIdentifier ($ name );
@@ -728,7 +697,7 @@ protected function _addUniqueConstraint(UniqueConstraint $constraint): self
728
697
$ indexName = $ this ->_generateIdentifierName (
729
698
array_merge ([$ this ->getName ()], $ constraint ->getColumns ()),
730
699
'idx ' ,
731
- $ this ->_getMaxIdentifierLength () ,
700
+ $ this ->maxIdentifierLength ,
732
701
);
733
702
734
703
$ indexCandidate = $ this ->_createIndex ($ constraint ->getColumns (), $ indexName , true , false );
@@ -751,7 +720,7 @@ protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint): s
751
720
: $ this ->_generateIdentifierName (
752
721
array_merge ((array ) $ this ->getName (), $ constraint ->getLocalColumns ()),
753
722
'fk ' ,
754
- $ this ->_getMaxIdentifierLength () ,
723
+ $ this ->maxIdentifierLength ,
755
724
);
756
725
757
726
$ name = $ this ->normalizeIdentifier ($ name );
@@ -765,7 +734,7 @@ protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint): s
765
734
$ indexName = $ this ->_generateIdentifierName (
766
735
array_merge ([$ this ->getName ()], $ constraint ->getLocalColumns ()),
767
736
'idx ' ,
768
- $ this ->_getMaxIdentifierLength () ,
737
+ $ this ->maxIdentifierLength ,
769
738
);
770
739
771
740
$ indexCandidate = $ this ->_createIndex ($ constraint ->getLocalColumns (), $ indexName , false , false );
0 commit comments