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