Completed
Push — 14.x ( 5d2466 )
by Tim
05:11
created

EeBundleSubject::mapSkuToRowId()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 4
cp 0
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Bundle\Ee\Subjects\EeBundleSubject
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2019 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/techdivision/import-product-bundle-ee
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Product\Bundle\Ee\Subjects;
22
23
use TechDivision\Import\Utils\RegistryKeys;
24
use TechDivision\Import\Product\Ee\Subjects\EeBunchSubject;
25
use TechDivision\Import\Product\Bundle\Subjects\BundleSubjectTrait;
26
27
/**
28
 * A subject implementation that provides extended functionality for importing
29
 * bundles in Magento 2 EE edition.
30
 *
31
 * @author    Tim Wagner <[email protected]>
32
 * @copyright 2019 TechDivision GmbH <[email protected]>
33
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
 * @link      https://github.com/techdivision/import-product-bundle-ee
35
 * @link      http://www.techdivision.com
36
 */
37
class EeBundleSubject extends EeBunchSubject
38
{
39
40
    /**
41
     * The trait that provides the functionality to handle bundle import on subject level.
42
     *
43
     * @var \TechDivision\Import\Product\Bundle\Subjects\BundleSubjectTrait
44
     */
45
    use BundleSubjectTrait;
46
47
    /**
48
     * Intializes the previously loaded global data for exactly one variants.
49
     *
50
     * @param string $serial The serial of the actual import
51
     *
52
     * @return void
53
     */
54
    public function setUp($serial)
55
    {
56
57
        // invoke the parent method
58
        parent::setUp($serial);
59
60
        // load the entity manager and the registry processor
61
        $registryProcessor = $this->getRegistryProcessor();
62
63
        // load the status of the actual import process
64
        $status = $registryProcessor->getAttribute(RegistryKeys::STATUS);
65
66
        // load the SKU => row/entity ID mapping
67
        $this->skuRowIdMapping = $status[RegistryKeys::SKU_ROW_ID_MAPPING];
68
        $this->skuEntityIdMapping = $status[RegistryKeys::SKU_ENTITY_ID_MAPPING];
69
    }
70
}
71