BunchSubject   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 38
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 14 1
1
<?php
2
3
/**
4
 * TechDivision\Import\Customer\Address\Subjects\BunchSubject
5
 *
6
 * PHP version 7
7
 *
8
 * @author    Tim Wagner <[email protected]>
9
 * @copyright 2018 TechDivision GmbH <[email protected]>
10
 * @license   https://opensource.org/licenses/MIT
11
 * @link      https://github.com/techdivision/import-customer-address
12
 * @link      http://www.techdivision.com
13
 */
14
15
namespace TechDivision\Import\Customer\Address\Subjects;
16
17
use TechDivision\Import\Subjects\ExportableTrait;
18
use TechDivision\Import\Subjects\ExportableSubjectInterface;
19
use TechDivision\Import\Customer\Address\Utils\RegistryKeys;
20
21
/**
22
 * The subject implementation that handles the business logic to persist customer addresses.
23
 *
24
 * @author    Tim Wagner <[email protected]>
25
 * @copyright 2018 TechDivision GmbH <[email protected]>
26
 * @license   https://opensource.org/licenses/MIT
27
 * @link      https://github.com/techdivision/import-customer-address
28
 * @link      http://www.techdivision.com
29
 */
30
class BunchSubject extends AbstractCustomerAddressSubject implements ExportableSubjectInterface
31
{
32
33
    /**
34
     * The trait that implements the export functionality.
35
     *
36
     * @var \TechDivision\Import\Subjects\ExportableTrait
37
     */
38
    use ExportableTrait;
39
40
    /**
41
     * The array with the pre-loaded entity IDs.
42
     *
43
     * @var array
44
     */
45
    protected $preLoadedEntityIds = array();
46
47
    /**
48
     * Clean up the global data after importing the bunch.
49
     *
50
     * @param string $serial The serial of the actual import
51
     *
52
     * @return void
53
     */
54
    public function tearDown($serial)
55
    {
56
57
        // invoke the parent method
58
        parent::tearDown($serial);
59
60
        // load the registry processor
61
        $registryProcessor = $this->getRegistryProcessor();
62
63
        // update the status
64
        $registryProcessor->mergeAttributesRecursive(
65
            RegistryKeys::STATUS,
66
            array(
67
                RegistryKeys::PRE_LOADED_ENTITY_IDS => $this->preLoadedEntityIds,
68
            )
69
        );
70
    }
71
}
72