Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Topics | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
30 | |
0.00% |
0 / 1 |
| runImport | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
30 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsdldb\Importer\MySQL; |
| 4 | |
| 5 | class Topics extends Base |
| 6 | { |
| 7 | protected $entityClass = '\\BO\\Zmsdldb\\Importer\\MySQL\\Entity\\Topic'; |
| 8 | |
| 9 | #[\Override] |
| 10 | public function runImport(): bool |
| 11 | { |
| 12 | try { |
| 13 | if ($this->needsUpdate()) { |
| 14 | foreach ($this->getIterator() as $topic) { |
| 15 | $topic = $this->createEntity($topic); |
| 16 | $this->removeEntityFromCurrentList($topic->get('id')); |
| 17 | $topic->save(); |
| 18 | } |
| 19 | } |
| 20 | foreach ($this->getCurrentEntitys() as $entityToDelete) { |
| 21 | $entityToDelete->delete(); |
| 22 | } |
| 23 | $this->saveMetaObject(); |
| 24 | } catch (\Exception $e) { |
| 25 | throw $e; |
| 26 | } |
| 27 | |
| 28 | return true; |
| 29 | } |
| 30 | } |