1 | <?php |
||
13 | abstract class AbstractDatabaseManipulator |
||
14 | { |
||
15 | |||
16 | const CONVERT_TO_DRIVER = 'driver'; |
||
17 | const CONVERT_TO_YENTU = 'yentu'; |
||
18 | |||
19 | private $schemaDescription; |
||
20 | private $assertor; |
||
21 | private $connection; |
||
22 | private $dumpQuery; |
||
23 | private $disableQuery; |
||
24 | protected $defaultSchema; |
||
25 | private $io; |
||
26 | |||
27 | /** |
||
28 | * AbstractDatabaseManipulator constructor. |
||
29 | * @param DriverFactory $driverFactory |
||
30 | * @param Io $io |
||
31 | * @throws \ntentan\atiaa\exceptions\ConnectionException |
||
32 | */ |
||
33 | 32 | public function __construct(DriverFactory $driverFactory, Io $io) |
|
39 | |||
40 | 32 | public function __get($name) |
|
46 | |||
47 | 9 | public function setDumpQuery($dumpQuery) |
|
51 | |||
52 | 9 | public function setDisableQuery($disableQuery) |
|
56 | |||
57 | 29 | public function __call($name, $arguments) |
|
69 | |||
70 | 29 | public function query($query, $bind = false) |
|
86 | |||
87 | 26 | public function disconnect() |
|
91 | |||
92 | 1 | public function getDefaultSchema() |
|
93 | { |
||
94 | 1 | return $this->connection->getDefaultSchema(); |
|
95 | } |
||
96 | |||
97 | 29 | public function getAssertor() |
|
104 | |||
105 | abstract protected function _addSchema($name); |
||
106 | |||
107 | abstract protected function _dropSchema($name); |
||
108 | |||
109 | abstract protected function _addTable($details); |
||
110 | |||
111 | abstract protected function _dropTable($details); |
||
112 | |||
113 | abstract protected function _changeTableName($details); |
||
114 | |||
115 | abstract protected function _addColumn($details); |
||
116 | |||
117 | abstract protected function _changeColumnNulls($details); |
||
118 | |||
119 | abstract protected function _changeColumnName($details); |
||
120 | |||
121 | abstract protected function _changeColumnDefault($details); |
||
122 | |||
123 | abstract protected function _dropColumn($details); |
||
124 | |||
125 | abstract protected function _addPrimaryKey($details); |
||
126 | |||
127 | abstract protected function _dropPrimaryKey($details); |
||
128 | |||
129 | abstract protected function _addUniqueKey($details); |
||
130 | |||
131 | abstract protected function _dropUniqueKey($details); |
||
132 | |||
133 | abstract protected function _addAutoPrimaryKey($details); |
||
134 | |||
135 | abstract protected function _dropAutoPrimaryKey($details); |
||
136 | |||
137 | abstract protected function _addForeignKey($details); |
||
138 | |||
139 | abstract protected function _dropForeignKey($details); |
||
140 | |||
141 | abstract protected function _addIndex($details); |
||
142 | |||
143 | abstract protected function _dropIndex($details); |
||
144 | |||
145 | abstract protected function _addView($details); |
||
146 | |||
147 | abstract protected function _dropView($details); |
||
148 | |||
149 | abstract protected function _changeViewDefinition($details); |
||
150 | |||
151 | protected function _changeForeignKeyOnDelete($details) |
||
156 | |||
157 | protected function _changeForeignKeyOnUpdate($details) |
||
162 | |||
163 | protected function _executeQuery($details) |
||
167 | |||
168 | protected function _reverseQuery($details) |
||
172 | |||
173 | abstract public function convertTypes($type, $direction, $length); |
||
174 | |||
175 | /** |
||
176 | * |
||
177 | * @return SchemaDescription |
||
178 | */ |
||
179 | 32 | public function getDescription() |
|
186 | |||
187 | 8 | public function setVersion($version) |
|
191 | |||
192 | public function getVersion() |
||
197 | |||
198 | 6 | public function getLastSession() |
|
203 | |||
204 | 3 | public function getSessionVersions($session) |
|
217 | |||
218 | 26 | public function createHistory() |
|
238 | |||
239 | 9 | public function __clone() |
|
245 | |||
246 | } |
||
247 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.