1 | <?php |
||||
2 | |||||
3 | namespace TheCodingMachine\TDBM\Schema; |
||||
4 | |||||
5 | use Doctrine\DBAL\Connection; |
||||
6 | use Doctrine\DBAL\Platforms\AbstractPlatform; |
||||
7 | use Doctrine\DBAL\Schema\AbstractSchemaManager; |
||||
8 | use Doctrine\DBAL\Schema\Column; |
||||
9 | use Doctrine\DBAL\Schema\Constraint; |
||||
10 | use Doctrine\DBAL\Schema\ForeignKeyConstraint; |
||||
11 | use Doctrine\DBAL\Schema\Index; |
||||
12 | use Doctrine\DBAL\Schema\Sequence; |
||||
13 | use Doctrine\DBAL\Schema\Table; |
||||
14 | use Doctrine\DBAL\Schema\TableDiff; |
||||
15 | use Doctrine\DBAL\Schema\View; |
||||
16 | use TheCodingMachine\TDBM\SchemaLockFileDumper; |
||||
17 | |||||
18 | /** |
||||
19 | * A DBAL SchemaManager that reads the schema from the lock file instead of reading it from the database. |
||||
20 | * Useful to avoid costly introspection queries at runtime. |
||||
21 | * |
||||
22 | * Acts as an adapter on top of an existing schema manager. |
||||
23 | */ |
||||
24 | class LockFileSchemaManager extends AbstractSchemaManager |
||||
25 | { |
||||
26 | /** |
||||
27 | * @var AbstractSchemaManager |
||||
28 | */ |
||||
29 | private $schemaManager; |
||||
30 | /** |
||||
31 | * @var SchemaLockFileDumper |
||||
32 | */ |
||||
33 | private $schemaLockFileDumper; |
||||
34 | |||||
35 | public function __construct(AbstractSchemaManager $schemaManager, SchemaLockFileDumper $schemaLockFileDumper) |
||||
36 | { |
||||
37 | $this->schemaManager = $schemaManager; |
||||
38 | $this->schemaLockFileDumper = $schemaLockFileDumper; |
||||
39 | } |
||||
40 | |||||
41 | public function getDatabasePlatform() |
||||
42 | { |
||||
43 | return $this->schemaManager->getDatabasePlatform(); |
||||
0 ignored issues
–
show
|
|||||
44 | } |
||||
45 | |||||
46 | public function tryMethod() |
||||
47 | { |
||||
48 | return $this->schemaManager->tryMethod(); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...emaManager::tryMethod() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
49 | } |
||||
50 | |||||
51 | public function listDatabases() |
||||
52 | { |
||||
53 | return $this->schemaManager->listDatabases(); |
||||
54 | } |
||||
55 | |||||
56 | public function listNamespaceNames() |
||||
57 | { |
||||
58 | return $this->schemaManager->listNamespaceNames(); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...r::listNamespaceNames() has been deprecated: Use {@see listSchemaNames()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
59 | } |
||||
60 | |||||
61 | public function listSequences($database = null) |
||||
62 | { |
||||
63 | return $this->schemaManager->listSequences($database); |
||||
64 | } |
||||
65 | |||||
66 | public function listTableColumns($table, $database = null) |
||||
67 | { |
||||
68 | return $this->schemaManager->listTableColumns($table, $database); |
||||
69 | } |
||||
70 | |||||
71 | public function listTableIndexes($table) |
||||
72 | { |
||||
73 | return $this->schemaManager->listTableIndexes($table); |
||||
74 | } |
||||
75 | |||||
76 | public function tablesExist($tableNames) |
||||
77 | { |
||||
78 | return $this->schemaManager->tablesExist($tableNames); |
||||
79 | } |
||||
80 | |||||
81 | public function listTableNames() |
||||
82 | { |
||||
83 | return $this->schemaManager->listTableNames(); |
||||
84 | } |
||||
85 | |||||
86 | protected function filterAssetNames($assetNames) |
||||
87 | { |
||||
88 | return $this->schemaManager->filterAssetNames($assetNames); |
||||
89 | } |
||||
90 | |||||
91 | protected function getFilterSchemaAssetsExpression() |
||||
92 | { |
||||
93 | return $this->schemaManager->getFilterSchemaAssetsExpression(); |
||||
0 ignored issues
–
show
The method
getFilterSchemaAssetsExpression() does not exist on Doctrine\DBAL\Schema\AbstractSchemaManager . It seems like you code against a sub-type of Doctrine\DBAL\Schema\AbstractSchemaManager such as TheCodingMachine\TDBM\Schema\LockFileSchemaManager .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
94 | } |
||||
95 | |||||
96 | public function listTables() |
||||
97 | { |
||||
98 | return $this->schemaManager->listTables(); |
||||
99 | } |
||||
100 | |||||
101 | public function listTableDetails($tableName) |
||||
102 | { |
||||
103 | return $this->schemaManager->listTableDetails($tableName); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...ger::listTableDetails() has been deprecated: Use {@see introspectTable()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
104 | } |
||||
105 | |||||
106 | public function listViews() |
||||
107 | { |
||||
108 | return $this->schemaManager->listViews(); |
||||
109 | } |
||||
110 | |||||
111 | public function listTableForeignKeys($table, $database = null) |
||||
112 | { |
||||
113 | return $this->schemaManager->listTableForeignKeys($table, $database); |
||||
114 | } |
||||
115 | |||||
116 | public function dropDatabase($database) |
||||
117 | { |
||||
118 | $this->schemaManager->dropDatabase($database); |
||||
119 | } |
||||
120 | |||||
121 | public function dropTable($tableName) |
||||
122 | { |
||||
123 | $this->schemaManager->dropTable($tableName); |
||||
124 | } |
||||
125 | |||||
126 | public function dropIndex($index, $table) |
||||
127 | { |
||||
128 | $this->schemaManager->dropIndex($index, $table); |
||||
129 | } |
||||
130 | |||||
131 | public function dropConstraint(Constraint $constraint, $table) |
||||
132 | { |
||||
133 | $this->schemaManager->dropConstraint($constraint, $table); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...nager::dropConstraint() has been deprecated: Use {@see dropIndex()}, {@see dropForeignKey()} or {@see dropUniqueConstraint()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
134 | } |
||||
135 | |||||
136 | public function dropForeignKey($foreignKey, $table) |
||||
137 | { |
||||
138 | $this->schemaManager->dropForeignKey($foreignKey, $table); |
||||
139 | } |
||||
140 | |||||
141 | public function dropSequence($name) |
||||
142 | { |
||||
143 | $this->schemaManager->dropSequence($name); |
||||
144 | } |
||||
145 | |||||
146 | public function dropView($name) |
||||
147 | { |
||||
148 | $this->schemaManager->dropView($name); |
||||
149 | } |
||||
150 | |||||
151 | public function createDatabase($database) |
||||
152 | { |
||||
153 | $this->schemaManager->createDatabase($database); |
||||
154 | } |
||||
155 | |||||
156 | public function createTable(Table $table) |
||||
157 | { |
||||
158 | $this->schemaManager->createTable($table); |
||||
159 | } |
||||
160 | |||||
161 | public function createSequence($sequence) |
||||
162 | { |
||||
163 | $this->schemaManager->createSequence($sequence); |
||||
164 | } |
||||
165 | |||||
166 | public function createConstraint(Constraint $constraint, $table) |
||||
167 | { |
||||
168 | $this->schemaManager->createConstraint($constraint, $table); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...ger::createConstraint() has been deprecated: Use {@see createIndex()}, {@see createForeignKey()} or {@see createUniqueConstraint()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
169 | } |
||||
170 | |||||
171 | public function createIndex(Index $index, $table) |
||||
172 | { |
||||
173 | $this->schemaManager->createIndex($index, $table); |
||||
174 | } |
||||
175 | |||||
176 | public function createForeignKey(ForeignKeyConstraint $foreignKey, $table) |
||||
177 | { |
||||
178 | $this->schemaManager->createForeignKey($foreignKey, $table); |
||||
179 | } |
||||
180 | |||||
181 | public function createView(View $view) |
||||
182 | { |
||||
183 | $this->schemaManager->createView($view); |
||||
184 | } |
||||
185 | |||||
186 | public function dropAndCreateConstraint(Constraint $constraint, $table) |
||||
187 | { |
||||
188 | $this->schemaManager->dropAndCreateConstraint($constraint, $table); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...opAndCreateConstraint() has been deprecated: Use {@see dropIndex()} and {@see createIndex()}, {@see dropForeignKey()} and {@see createForeignKey()} or {@see dropUniqueConstraint()} and {@see createUniqueConstraint()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
189 | } |
||||
190 | |||||
191 | public function dropAndCreateIndex(Index $index, $table) |
||||
192 | { |
||||
193 | $this->schemaManager->dropAndCreateIndex($index, $table); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...r::dropAndCreateIndex() has been deprecated: Use {@see dropIndex()} and {@see createIndex()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
194 | } |
||||
195 | |||||
196 | public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table) |
||||
197 | { |
||||
198 | $this->schemaManager->dropAndCreateForeignKey($foreignKey, $table); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...opAndCreateForeignKey() has been deprecated: Use {@see dropForeignKey()} and {@see createForeignKey()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
199 | } |
||||
200 | |||||
201 | public function dropAndCreateSequence(Sequence $sequence) |
||||
202 | { |
||||
203 | $this->schemaManager->dropAndCreateSequence($sequence); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...dropAndCreateSequence() has been deprecated: Use {@see dropSequence()} and {@see createSequence()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
204 | } |
||||
205 | |||||
206 | public function dropAndCreateTable(Table $table) |
||||
207 | { |
||||
208 | $this->schemaManager->dropAndCreateTable($table); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...r::dropAndCreateTable() has been deprecated: Use {@see dropTable()} and {@see createTable()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
209 | } |
||||
210 | |||||
211 | public function dropAndCreateDatabase($database) |
||||
212 | { |
||||
213 | $this->schemaManager->dropAndCreateDatabase($database); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...dropAndCreateDatabase() has been deprecated: Use {@see dropDatabase()} and {@see createDatabase()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
214 | } |
||||
215 | |||||
216 | public function dropAndCreateView(View $view) |
||||
217 | { |
||||
218 | $this->schemaManager->dropAndCreateView($view); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...er::dropAndCreateView() has been deprecated: Use {@see dropView()} and {@see createView()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
219 | } |
||||
220 | |||||
221 | public function alterTable(TableDiff $tableDiff) |
||||
222 | { |
||||
223 | $this->schemaManager->alterTable($tableDiff); |
||||
224 | } |
||||
225 | |||||
226 | public function renameTable($name, $newName) |
||||
227 | { |
||||
228 | $this->schemaManager->renameTable($name, $newName); |
||||
229 | } |
||||
230 | |||||
231 | protected function _getPortableDatabasesList($databases) |
||||
232 | { |
||||
233 | return $this->schemaManager->_getPortableDatabasesList($databases); |
||||
234 | } |
||||
235 | |||||
236 | protected function getPortableNamespacesList(array $namespaces) |
||||
237 | { |
||||
238 | return $this->schemaManager->getPortableNamespacesList($namespaces); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...ortableNamespacesList() has been deprecated: Use {@see listSchemaNames()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
239 | } |
||||
240 | |||||
241 | protected function _getPortableDatabaseDefinition($database) |
||||
242 | { |
||||
243 | return $this->schemaManager->_getPortableDatabaseDefinition($database); |
||||
244 | } |
||||
245 | |||||
246 | protected function getPortableNamespaceDefinition(array $namespace) |
||||
247 | { |
||||
248 | return $this->schemaManager->getPortableNamespaceDefinition($namespace); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...leNamespaceDefinition() has been deprecated: Use {@see listSchemaNames()} instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
249 | } |
||||
250 | |||||
251 | protected function _getPortableFunctionsList($functions) |
||||
252 | { |
||||
253 | return $this->schemaManager->_getPortableFunctionsList($functions); |
||||
0 ignored issues
–
show
The method
_getPortableFunctionsList() does not exist on Doctrine\DBAL\Schema\AbstractSchemaManager . Did you maybe mean _getPortableSequencesList() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
254 | } |
||||
255 | |||||
256 | protected function _getPortableFunctionDefinition($function) |
||||
257 | { |
||||
258 | return $this->schemaManager->_getPortableFunctionDefinition($function); |
||||
0 ignored issues
–
show
The method
_getPortableFunctionDefinition() does not exist on Doctrine\DBAL\Schema\AbstractSchemaManager . It seems like you code against a sub-type of Doctrine\DBAL\Schema\AbstractSchemaManager such as TheCodingMachine\TDBM\Schema\LockFileSchemaManager .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
259 | } |
||||
260 | |||||
261 | protected function _getPortableTriggersList($triggers) |
||||
262 | { |
||||
263 | return $this->schemaManager->_getPortableTriggersList($triggers); |
||||
0 ignored issues
–
show
The method
_getPortableTriggersList() does not exist on Doctrine\DBAL\Schema\AbstractSchemaManager . Did you maybe mean _getPortableViewsList() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
264 | } |
||||
265 | |||||
266 | protected function _getPortableTriggerDefinition($trigger) |
||||
267 | { |
||||
268 | return $this->schemaManager->_getPortableTriggerDefinition($trigger); |
||||
0 ignored issues
–
show
The method
_getPortableTriggerDefinition() does not exist on Doctrine\DBAL\Schema\AbstractSchemaManager . Did you maybe mean _getPortableViewDefinition() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
269 | } |
||||
270 | |||||
271 | protected function _getPortableSequencesList($sequences) |
||||
272 | { |
||||
273 | return $this->schemaManager->_getPortableSequencesList($sequences); |
||||
274 | } |
||||
275 | |||||
276 | protected function _getPortableSequenceDefinition($sequence) |
||||
277 | { |
||||
278 | return $this->schemaManager->_getPortableSequenceDefinition($sequence); |
||||
279 | } |
||||
280 | |||||
281 | protected function _getPortableTableColumnList($table, $database, $tableColumns) |
||||
282 | { |
||||
283 | return $this->schemaManager->_getPortableTableColumnList($table, $database, $tableColumns); |
||||
284 | } |
||||
285 | |||||
286 | protected function _getPortableTableIndexesList($tableIndexRows, $tableName = null) |
||||
287 | { |
||||
288 | return $this->schemaManager->_getPortableTableIndexesList($tableIndexRows, $tableName); |
||||
289 | } |
||||
290 | |||||
291 | protected function _getPortableTablesList($tables) |
||||
292 | { |
||||
293 | return $this->schemaManager->_getPortableTablesList($tables); |
||||
294 | } |
||||
295 | |||||
296 | protected function _getPortableTableDefinition($table) |
||||
297 | { |
||||
298 | return $this->schemaManager->_getPortableTableDefinition($table); |
||||
299 | } |
||||
300 | |||||
301 | protected function _getPortableUsersList($users) |
||||
302 | { |
||||
303 | return $this->schemaManager->_getPortableUsersList($users); |
||||
0 ignored issues
–
show
The method
_getPortableUsersList() does not exist on Doctrine\DBAL\Schema\AbstractSchemaManager . Did you maybe mean _getPortableViewsList() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
304 | } |
||||
305 | |||||
306 | protected function _getPortableUserDefinition($user) |
||||
307 | { |
||||
308 | return $this->schemaManager->_getPortableUserDefinition($user); |
||||
0 ignored issues
–
show
The method
_getPortableUserDefinition() does not exist on Doctrine\DBAL\Schema\AbstractSchemaManager . Did you maybe mean _getPortableTableDefinition() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
309 | } |
||||
310 | |||||
311 | protected function _getPortableViewsList($views) |
||||
312 | { |
||||
313 | return $this->schemaManager->_getPortableViewsList($views); |
||||
314 | } |
||||
315 | |||||
316 | protected function _getPortableViewDefinition($view) |
||||
317 | { |
||||
318 | return $this->schemaManager->_getPortableViewDefinition($view); |
||||
319 | } |
||||
320 | |||||
321 | protected function _getPortableTableForeignKeysList($tableForeignKeys) |
||||
322 | { |
||||
323 | return $this->schemaManager->_getPortableTableForeignKeysList($tableForeignKeys); |
||||
324 | } |
||||
325 | |||||
326 | protected function _getPortableTableForeignKeyDefinition($tableForeignKey) |
||||
327 | { |
||||
328 | return $this->schemaManager->_getPortableTableForeignKeyDefinition($tableForeignKey); |
||||
329 | } |
||||
330 | |||||
331 | protected function _execSql($sql) |
||||
332 | { |
||||
333 | $this->schemaManager->_execSql($sql); |
||||
334 | } |
||||
335 | |||||
336 | public function createSchema() |
||||
337 | { |
||||
338 | return $this->schemaLockFileDumper->getSchema(); |
||||
339 | } |
||||
340 | |||||
341 | public function createSchemaConfig() |
||||
342 | { |
||||
343 | return $this->schemaManager->createSchemaConfig(); |
||||
344 | } |
||||
345 | |||||
346 | public function getSchemaSearchPaths() |
||||
347 | { |
||||
348 | return $this->schemaManager->getSchemaSearchPaths(); |
||||
0 ignored issues
–
show
The function
Doctrine\DBAL\Schema\Abs...:getSchemaSearchPaths() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
349 | } |
||||
350 | |||||
351 | public function extractDoctrineTypeFromComment($comment, $currentType) |
||||
352 | { |
||||
353 | return $this->schemaManager->extractDoctrineTypeFromComment($comment, $currentType); |
||||
354 | } |
||||
355 | |||||
356 | public function removeDoctrineTypeFromComment($comment, $type) |
||||
357 | { |
||||
358 | return $this->schemaManager->removeDoctrineTypeFromComment($comment, $type); |
||||
359 | } |
||||
360 | |||||
361 | protected function _getPortableTableColumnDefinition($tableColumn) |
||||
362 | { |
||||
363 | return $this->schemaManager->_getPortableTableColumnDefinition($tableColumn); |
||||
364 | } |
||||
365 | } |
||||
366 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.