1 | <?php |
||
23 | class SynchronizationPool extends Component |
||
24 | { |
||
25 | /** |
||
26 | * @var AbstractTable[] |
||
27 | */ |
||
28 | private $tables = []; |
||
29 | |||
30 | /** |
||
31 | * @var Driver[] |
||
32 | */ |
||
33 | private $drivers = []; |
||
34 | |||
35 | /** |
||
36 | * @param AbstractTable[] $tables |
||
37 | */ |
||
38 | public function __construct(array $tables) |
||
44 | |||
45 | /** |
||
46 | * @return AbstractTable[] |
||
47 | */ |
||
48 | public function getTables() |
||
52 | |||
53 | /** |
||
54 | * List of tables sorted in order of cross dependency. |
||
55 | * |
||
56 | * @return AbstractTable[] |
||
57 | */ |
||
58 | public function sortedTables(): array |
||
70 | |||
71 | /** |
||
72 | * Synchronize tables. |
||
73 | * |
||
74 | * @param LoggerInterface|null $logger |
||
75 | * |
||
76 | * @throws \Exception |
||
77 | * @throws \Throwable |
||
78 | */ |
||
79 | public function run(LoggerInterface $logger = null) |
||
130 | |||
131 | /** |
||
132 | * Begin mass transaction. |
||
133 | */ |
||
134 | protected function beginTransaction() |
||
140 | |||
141 | /** |
||
142 | * Commit mass transaction. |
||
143 | */ |
||
144 | protected function commitTransaction() |
||
150 | |||
151 | /** |
||
152 | * Roll back mass transaction. |
||
153 | */ |
||
154 | protected function rollbackTransaction() |
||
160 | |||
161 | /** |
||
162 | * Collecting all involved drivers. |
||
163 | */ |
||
164 | private function collectDrivers() |
||
172 | } |
||
173 |