1 | <?php |
||
16 | class SchemaTable |
||
17 | { |
||
18 | private $connection; |
||
19 | private $manipulation; |
||
20 | private $info; |
||
21 | |||
22 | /** |
||
23 | * Constructor. |
||
24 | * |
||
25 | * @param Connection $connection Connection instance. |
||
26 | * @param Manipulation $manipulation Manipulation instance. |
||
27 | * @param Info $info Info instance. |
||
28 | */ |
||
29 | public function __construct(Connection $connection, Manipulation $manipulation, Info $info) |
||
35 | |||
36 | /** |
||
37 | * Migrare to given version. |
||
38 | * |
||
39 | * @param string $version Version of migration. |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public function migrateToVersion($version) |
||
53 | |||
54 | /** |
||
55 | * Get all versions of migrations. |
||
56 | * |
||
57 | * @return array Versions of migrations. |
||
58 | */ |
||
59 | public function getVersions() |
||
70 | |||
71 | /** |
||
72 | * Get current version of migration. |
||
73 | * |
||
74 | * @return integer |
||
75 | */ |
||
76 | public function getCurrentVersion() |
||
82 | |||
83 | /** |
||
84 | * Get previous version of migration. |
||
85 | * |
||
86 | * @return integer |
||
87 | */ |
||
88 | public function getPreviousVersion() |
||
94 | |||
95 | /** |
||
96 | * Add a new migrate entry. |
||
97 | * |
||
98 | * @param string $version Version of migration. |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | private function up($version) |
||
107 | |||
108 | /** |
||
109 | * Delete a migrate entry. |
||
110 | * |
||
111 | * @param string $version Version of migration. |
||
112 | * |
||
113 | * @return void |
||
114 | */ |
||
115 | private function down($version) |
||
120 | |||
121 | /** |
||
122 | * Create schema table if not exists. |
||
123 | * |
||
124 | * @return void |
||
125 | */ |
||
126 | private function createIfNotExists() |
||
141 | } |
||
142 |