1 | <?php |
||
17 | class SchemaDiff |
||
18 | { |
||
19 | /** |
||
20 | * @var \Doctrine\DBAL\Schema\Schema |
||
21 | */ |
||
22 | public $fromSchema; |
||
23 | |||
24 | /** |
||
25 | * All added namespaces. |
||
26 | * |
||
27 | * @var string[] |
||
28 | */ |
||
29 | public $newNamespaces = array(); |
||
30 | |||
31 | /** |
||
32 | * All removed namespaces. |
||
33 | * |
||
34 | * @var string[] |
||
35 | */ |
||
36 | public $removedNamespaces = array(); |
||
37 | |||
38 | /** |
||
39 | * All added tables. |
||
40 | * |
||
41 | * @var \Doctrine\DBAL\Schema\Table[] |
||
42 | */ |
||
43 | public $newTables = array(); |
||
44 | |||
45 | /** |
||
46 | * All changed tables. |
||
47 | * |
||
48 | * @var \Doctrine\DBAL\Schema\TableDiff[] |
||
49 | */ |
||
50 | public $changedTables = array(); |
||
51 | |||
52 | /** |
||
53 | * All removed tables. |
||
54 | * |
||
55 | * @var \Doctrine\DBAL\Schema\Table[] |
||
56 | */ |
||
57 | public $removedTables = array(); |
||
58 | |||
59 | /** |
||
60 | * @var \Doctrine\DBAL\Schema\Sequence[] |
||
61 | */ |
||
62 | public $newSequences = array(); |
||
63 | |||
64 | /** |
||
65 | * @var \Doctrine\DBAL\Schema\Sequence[] |
||
66 | */ |
||
67 | public $changedSequences = array(); |
||
68 | |||
69 | /** |
||
70 | * @var \Doctrine\DBAL\Schema\Sequence[] |
||
71 | */ |
||
72 | public $removedSequences = array(); |
||
73 | |||
74 | /** |
||
75 | * @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[] |
||
76 | */ |
||
77 | public $orphanedForeignKeys = array(); |
||
78 | |||
79 | /** |
||
80 | * Constructs an SchemaDiff object. |
||
81 | * |
||
82 | * @param \Doctrine\DBAL\Schema\Table[] $newTables |
||
83 | * @param \Doctrine\DBAL\Schema\TableDiff[] $changedTables |
||
84 | * @param \Doctrine\DBAL\Schema\Table[] $removedTables |
||
85 | * @param \Doctrine\DBAL\Schema\Schema|null $fromSchema |
||
86 | */ |
||
87 | public function __construct($newTables = array(), $changedTables = array(), $removedTables = array(), $fromSchema = null) |
||
94 | |||
95 | /** |
||
96 | * The to save sql mode ensures that the following things don't happen: |
||
97 | * |
||
98 | * 1. Tables are deleted |
||
99 | * 2. Sequences are deleted |
||
100 | * 3. Foreign Keys which reference tables that would otherwise be deleted. |
||
101 | * |
||
102 | * This way it is ensured that assets are deleted which might not be relevant to the metadata schema at all. |
||
103 | * |
||
104 | * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | public function toSaveSql(AbstractPlatform $platform) |
||
112 | |||
113 | /** |
||
114 | * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform |
||
115 | * |
||
116 | * @return array |
||
117 | */ |
||
118 | public function toSql(AbstractPlatform $platform) |
||
122 | |||
123 | /** |
||
124 | * @SuppressWarnings(PHPMD.NPathComplexity) |
||
125 | * @SuppressWarnings(PHPMD.CyclomaticComplexity) |
||
126 | * |
||
127 | * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform |
||
128 | * @param boolean $saveMode |
||
129 | * |
||
130 | * @return array |
||
131 | */ |
||
132 | protected function _toSql(AbstractPlatform $platform, $saveMode = false) |
||
194 | |||
195 | protected function disableIndicesRenaming() |
||
201 | } |
||
202 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.