1 | <?php |
---|
2 | /* |
---|
3 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
4 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
5 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
6 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
---|
7 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
8 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
---|
9 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
---|
10 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
---|
11 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
---|
12 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
---|
13 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
14 | * |
---|
15 | * This software consists of voluntary contributions made by many individuals |
---|
16 | * and is licensed under the LGPL. For more information, see |
---|
17 | * <http://www.doctrine-project.org>. |
---|
18 | */ |
---|
19 | |
---|
20 | namespace Doctrine\DBAL\Schema; |
---|
21 | |
---|
22 | /** |
---|
23 | * Table Diff |
---|
24 | * |
---|
25 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL |
---|
26 | * @link www.doctrine-project.org |
---|
27 | * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved. |
---|
28 | * @license http://ez.no/licenses/new_bsd New BSD License |
---|
29 | * @since 2.0 |
---|
30 | * @author Benjamin Eberlei <kontakt@beberlei.de> |
---|
31 | */ |
---|
32 | class TableDiff |
---|
33 | { |
---|
34 | /** |
---|
35 | * @var string |
---|
36 | */ |
---|
37 | public $name = null; |
---|
38 | |
---|
39 | /** |
---|
40 | * @var string |
---|
41 | */ |
---|
42 | public $newName = false; |
---|
43 | |
---|
44 | /** |
---|
45 | * All added fields |
---|
46 | * |
---|
47 | * @var array(string=>Column) |
---|
48 | */ |
---|
49 | public $addedColumns; |
---|
50 | |
---|
51 | /** |
---|
52 | * All changed fields |
---|
53 | * |
---|
54 | * @var array(string=>Column) |
---|
55 | */ |
---|
56 | public $changedColumns = array(); |
---|
57 | |
---|
58 | /** |
---|
59 | * All removed fields |
---|
60 | * |
---|
61 | * @var array(string=>Column) |
---|
62 | */ |
---|
63 | public $removedColumns = array(); |
---|
64 | |
---|
65 | /** |
---|
66 | * Columns that are only renamed from key to column instance name. |
---|
67 | * |
---|
68 | * @var array(string=>Column) |
---|
69 | */ |
---|
70 | public $renamedColumns = array(); |
---|
71 | |
---|
72 | /** |
---|
73 | * All added indexes |
---|
74 | * |
---|
75 | * @var array(string=>Index) |
---|
76 | */ |
---|
77 | public $addedIndexes = array(); |
---|
78 | |
---|
79 | /** |
---|
80 | * All changed indexes |
---|
81 | * |
---|
82 | * @var array(string=>Index) |
---|
83 | */ |
---|
84 | public $changedIndexes = array(); |
---|
85 | |
---|
86 | /** |
---|
87 | * All removed indexes |
---|
88 | * |
---|
89 | * @var array(string=>bool) |
---|
90 | */ |
---|
91 | public $removedIndexes = array(); |
---|
92 | |
---|
93 | /** |
---|
94 | * All added foreign key definitions |
---|
95 | * |
---|
96 | * @var array |
---|
97 | */ |
---|
98 | public $addedForeignKeys = array(); |
---|
99 | |
---|
100 | /** |
---|
101 | * All changed foreign keys |
---|
102 | * |
---|
103 | * @var array |
---|
104 | */ |
---|
105 | public $changedForeignKeys = array(); |
---|
106 | |
---|
107 | /** |
---|
108 | * All removed foreign keys |
---|
109 | * |
---|
110 | * @var array |
---|
111 | */ |
---|
112 | public $removedForeignKeys = array(); |
---|
113 | |
---|
114 | /** |
---|
115 | * Constructs an TableDiff object. |
---|
116 | * |
---|
117 | * @param array(string=>Column) $addedColumns |
---|
118 | * @param array(string=>Column) $changedColumns |
---|
119 | * @param array(string=>bool) $removedColumns |
---|
120 | * @param array(string=>Index) $addedIndexes |
---|
121 | * @param array(string=>Index) $changedIndexes |
---|
122 | * @param array(string=>bool) $removedIndexes |
---|
123 | */ |
---|
124 | public function __construct($tableName, $addedColumns = array(), |
---|
125 | $changedColumns = array(), $removedColumns = array(), $addedIndexes = array(), |
---|
126 | $changedIndexes = array(), $removedIndexes = array()) |
---|
127 | { |
---|
128 | $this->name = $tableName; |
---|
129 | $this->addedColumns = $addedColumns; |
---|
130 | $this->changedColumns = $changedColumns; |
---|
131 | $this->removedColumns = $removedColumns; |
---|
132 | $this->addedIndexes = $addedIndexes; |
---|
133 | $this->changedIndexes = $changedIndexes; |
---|
134 | $this->removedIndexes = $removedIndexes; |
---|
135 | } |
---|
136 | } |
---|