1 | <?php |
||
22 | class SynchronizationPool extends Component |
||
23 | { |
||
24 | use LoggerTrait; |
||
25 | |||
26 | /** |
||
27 | * @var AbstractTable[] |
||
28 | */ |
||
29 | private $tables = []; |
||
30 | |||
31 | /** |
||
32 | * @var Driver[] |
||
33 | */ |
||
34 | private $drivers = []; |
||
35 | |||
36 | /** |
||
37 | * @param AbstractTable[] $tables |
||
38 | */ |
||
39 | public function __construct(array $tables) |
||
45 | |||
46 | /** |
||
47 | * @return AbstractTable[] |
||
48 | */ |
||
49 | public function getTables() |
||
53 | |||
54 | /** |
||
55 | * List of tables sorted in order of cross dependency. |
||
56 | * |
||
57 | * @return AbstractTable[] |
||
58 | */ |
||
59 | public function sortedTables(): array |
||
71 | |||
72 | /** |
||
73 | * Synchronize tables. |
||
74 | * |
||
75 | * @param LoggerInterface|null $logger |
||
76 | * |
||
77 | * @throws \Exception |
||
78 | * @throws \Throwable |
||
79 | */ |
||
80 | public function run(LoggerInterface $logger = null) |
||
114 | |||
115 | /** |
||
116 | * Begin mass transaction. |
||
117 | */ |
||
118 | protected function beginTransaction() |
||
126 | |||
127 | /** |
||
128 | * Commit mass transaction. |
||
129 | */ |
||
130 | protected function commitTransaction() |
||
138 | |||
139 | /** |
||
140 | * Roll back mass transaction. |
||
141 | */ |
||
142 | protected function rollbackTransaction() |
||
150 | |||
151 | /** |
||
152 | * Collecting all involved drivers. |
||
153 | */ |
||
154 | private function collectDrivers() |
||
162 | } |
||
163 |