Completed
Push — master ( 16a470...a3600c )
by Tim
14:14 queued 13:12
created

EeMediaSubject   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 41
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 16 1
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Media\Ee\Subjects\EeMediaSubject
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 2016 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-media-ee
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Product\Media\Ee\Subjects;
22
23
use TechDivision\Import\Utils\RegistryKeys;
24
use TechDivision\Import\Subjects\FileUploadTrait;
25
use TechDivision\Import\Subjects\FileUploadSubjectInterface;
26
use TechDivision\Import\Product\Ee\Subjects\EeBunchSubject;
27
use TechDivision\Import\Product\Media\Subjects\MediaSubjectTrait;
28
29
/**
30
 * A subject that handles the process to import product media.
31
 *
32
 * @author    Tim Wagner <[email protected]>
33
 * @copyright 2016 TechDivision GmbH <[email protected]>
34
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
35
 * @link      https://github.com/techdivision/import-product-media-ee
36
 * @link      http://www.techdivision.com
37
 */
38
class EeMediaSubject extends EeBunchSubject implements FileUploadSubjectInterface
39
{
40
41
    /**
42
     * The trait that provides file upload functionality.
43
     *
44
     * @var \TechDivision\Import\Subjects\FileUploadTrait
45
     */
46
    use FileUploadTrait;
47
48
    /**
49
     * The trait that provides media import functionality.
50
     *
51
     * @var \TechDivision\Import\Media\Subjects\MediaSubjectTrait
52
     */
53
    use MediaSubjectTrait;
54
55
    /**
56
     * Intializes the previously loaded global data for exactly one variants.
57
     *
58
     * @param string $serial The serial of the actual import
59
     *
60
     * @return void
61
     */
62 1
    public function setUp($serial)
63
    {
64
65
        // invoke the parent method
66 1
        parent::setUp($serial);
67
68
        // load the entity manager and the registry processor
69 1
        $registryProcessor = $this->getRegistryProcessor();
70
71
        // load the status of the actual import process
72 1
        $status = $registryProcessor->getAttribute(RegistryKeys::STATUS);
73
74
        // load the SKU => row/entity ID mapping
75 1
        $this->skuRowIdMapping = $status[RegistryKeys::SKU_ROW_ID_MAPPING];
76 1
        $this->skuEntityIdMapping = $status[RegistryKeys::SKU_ENTITY_ID_MAPPING];
77 1
    }
78
}
79