Completed
Push — master ( e5b919...026cf7 )
by Tim
05:11
created

loadProductMediaGalleryValueByValueIdAndStoreIdAndRowId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Media\Ee\Services\EeProductMediaProcessor
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
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Product\Media\Ee\Services;
22
23
use TechDivision\Import\Product\Media\Services\ProductMediaProcessor;
24
25
/**
26
 * A processor implementation that provides media import functionality for the Magento 2 EE.
27
 *
28
 * @author    Tim Wagner <[email protected]>
29
 * @copyright 2016 TechDivision GmbH <[email protected]>
30
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
31
 * @link      https://github.com/techdivision/import-product-media
32
 * @link      http://www.techdivision.com
33
 */
34
class EeProductMediaProcessor extends ProductMediaProcessor implements EeProductMediaProcessorInterface
35
{
36
37
    /**
38
     * Load's the product media gallery with the passed value/row ID.
39
     *
40
     * @param integer $valueId The value ID of the product media gallery value to entity to load
41
     * @param integer $rowId   The row ID of the product media gallery value to entity to load
42
     *
43
     * @return array The product media gallery
44
     */
45
    public function loadProductMediaGalleryValueToEntityByValueIdAndRowId($valueId, $rowId)
46
    {
47
        return $this->getProductMediaGalleryValueToEntityRepository()->findOneByValueIdAndEntityId($valueId, $rowId);
48
    }
49
50
    /**
51
     * Load's the product media gallery value with the passed value/store/row ID.
52
     *
53
     * @param integer $valueId The value ID of the product media gallery value to load
54
     * @param string  $storeId The store ID of the product media gallery value to load
55
     * @param string  $rowId   The row ID of the parent product of the product media gallery value to load
56
     *
57
     * @return array The product media gallery value
58
     */
59
    public function loadProductMediaGalleryValueByValueIdAndStoreIdAndRowId($valueId, $storeId, $rowId)
60
    {
61
        return $this->getProductMediaGalleryValueRepository()->findOneByValueIdAndStoreIdAndEntityId($valueId, $storeId, $rowId);
62
    }
63
}
64