1 | <?php |
||
19 | class ZohoSyncDatabaseCommand extends Command |
||
20 | { |
||
21 | /** |
||
22 | * The list of Zoho DAOs to copy. |
||
23 | * |
||
24 | * @var AbstractZohoDao[] |
||
25 | */ |
||
26 | private $zohoDaos; |
||
27 | |||
28 | /** |
||
29 | * @var ZohoDatabaseModelSync |
||
30 | */ |
||
31 | private $zohoDatabaseModelSync; |
||
32 | |||
33 | /** |
||
34 | * @var ZohoDatabaseCopier |
||
35 | */ |
||
36 | private $zohoDatabaseCopier; |
||
37 | |||
38 | /** |
||
39 | * @var ZohoDatabasePusher |
||
40 | */ |
||
41 | private $zohoDatabaseSync; |
||
42 | |||
43 | /** |
||
44 | * |
||
45 | * @var MultiLogger |
||
46 | */ |
||
47 | private $logger; |
||
48 | |||
49 | /** |
||
50 | * @var Lock |
||
51 | */ |
||
52 | private $lock; |
||
53 | |||
54 | /** |
||
55 | * The Zoho Dao and Beans generator |
||
56 | * @var EntitiesGeneratorService |
||
57 | */ |
||
58 | private $zohoEntitiesGenerator; |
||
59 | |||
60 | /** |
||
61 | * |
||
62 | * @var ZohoClient |
||
63 | */ |
||
64 | private $zohoClient; |
||
65 | |||
66 | private $pathZohoDaos; |
||
67 | |||
68 | private $namespaceZohoDaos; |
||
69 | |||
70 | /** |
||
71 | * |
||
72 | * @var Response |
||
73 | */ |
||
74 | private $usersResponse; |
||
|
|||
75 | |||
76 | |||
77 | /** |
||
78 | * @param ZohoDatabaseModelSync $zohoDatabaseModelSync |
||
79 | * @param ZohoDatabaseCopier $zohoDatabaseCopier |
||
80 | * @param ZohoDatabasePusher $zohoDatabaseSync |
||
81 | * @param EntitiesGeneratorService $zohoEntitiesGenerator The Zoho Dao and Beans generator |
||
82 | * @param ZohoClient $zohoClient |
||
83 | * @param string $pathZohoDaos Tht path where we need to generate the Daos. |
||
84 | * @param string $namespaceZohoDaos Daos namespace |
||
85 | * @param MultiLogger $logger |
||
86 | * @param Lock $lock A lock that can be used to avoid running the same command (copy) twice at the same time |
||
87 | */ |
||
88 | public function __construct(ZohoDatabaseModelSync $zohoDatabaseModelSync, ZohoDatabaseCopier $zohoDatabaseCopier, ZohoDatabasePusher $zohoDatabaseSync, |
||
103 | |||
104 | protected function configure() |
||
114 | |||
115 | protected function execute(InputInterface $input, OutputInterface $output) |
||
147 | |||
148 | /** |
||
149 | * Sychronizes the model of the database with Zoho records. |
||
150 | * |
||
151 | * @param OutputInterface $output |
||
152 | */ |
||
153 | private function syncModel(InputInterface $input, OutputInterface $output) |
||
164 | |||
165 | /** |
||
166 | * Sychronizes the model of the database with Zoho Users records. |
||
167 | * |
||
168 | * @param OutputInterface $output |
||
169 | */ |
||
170 | private function syncUserModel(OutputInterface $output) |
||
176 | |||
177 | |||
178 | /** |
||
179 | * @param AbstractZohoDao $zohoDao |
||
180 | * |
||
181 | * @return array |
||
182 | */ |
||
183 | private function getListFieldName(AbstractZohoDao $zohoDao) |
||
194 | |||
195 | /** |
||
196 | * Regerate Zoho Daos |
||
197 | * @param InputInterface $input |
||
198 | * @param OutputInterface $output |
||
199 | */ |
||
200 | private function regenerateZohoDao(OutputInterface $output) |
||
215 | |||
216 | /** |
||
217 | * Run the fetch User Db command. |
||
218 | * |
||
219 | * @param InputInterface $input |
||
220 | * @param OutputInterface $output |
||
221 | */ |
||
222 | private function fetchUserDb(InputInterface $input, OutputInterface $output) |
||
228 | |||
229 | |||
230 | /** |
||
231 | * Run the fetch Db command. |
||
232 | * |
||
233 | * @param InputInterface $input |
||
234 | * @param OutputInterface $output |
||
235 | */ |
||
236 | private function fetchDb(InputInterface $input, OutputInterface $output) |
||
253 | |||
254 | /** |
||
255 | * Run the push Db command. |
||
256 | * |
||
257 | * @param OutputInterface $output |
||
258 | */ |
||
259 | private function pushDb(OutputInterface $output) |
||
267 | } |
||
268 |
This check marks private properties in classes that are never used. Those properties can be removed.