1 | <?php |
||
12 | abstract class AbstractDatabase implements DatabaseInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var DbDriverInterface |
||
16 | */ |
||
17 | private $dbDriver; |
||
18 | |||
19 | /** |
||
20 | * @var UriInterface |
||
21 | */ |
||
22 | private $uri; |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $migrationTable; |
||
27 | |||
28 | /** |
||
29 | * Command constructor. |
||
30 | * |
||
31 | * @param UriInterface $uri |
||
32 | * @param string $migrationTable |
||
33 | */ |
||
34 | public function __construct(UriInterface $uri, $migrationTable = 'migration_version') |
||
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | public function getMigrationTable() |
||
47 | |||
48 | /** |
||
49 | * @return DbDriverInterface |
||
50 | */ |
||
51 | public function getDbDriver() |
||
58 | |||
59 | /** |
||
60 | * @return array |
||
61 | * @throws \ByJG\DbMigration\Exception\DatabaseNotVersionedException |
||
62 | * @throws \ByJG\DbMigration\Exception\OldVersionSchemaException |
||
63 | */ |
||
64 | public function getVersion() |
||
81 | |||
82 | /** |
||
83 | * @param $version |
||
84 | * @param $status |
||
85 | */ |
||
86 | public function setVersion($version, $status) |
||
96 | |||
97 | /** |
||
98 | * @throws \ByJG\DbMigration\Exception\DatabaseNotVersionedException |
||
99 | * @throws \ByJG\DbMigration\Exception\OldVersionSchemaException |
||
100 | */ |
||
101 | protected function checkExistsVersion() |
||
113 | |||
114 | /** |
||
115 | * |
||
116 | */ |
||
117 | public function updateVersionTable() |
||
124 | |||
125 | protected function isTableExists($schema, $table) |
||
139 | |||
140 | public function isDatabaseVersioned() |
||
144 | } |
||
145 |