Completed
Push — master ( 9b3686...89ef78 )
by Bernhard
07:29
created

Magic360ColumnsUpdateProcessor::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Magic360\Actions\Processors\ProductMediaGalleryUpdateProcessor
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
 * @author    Bernhard Wick <[email protected]>
16
 * @copyright 2017 TechDivision GmbH <[email protected]>
17
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
 * @link      https://github.com/techdivision/import-product-magic360
19
 * @link      http://www.techdivision.com
20
 */
21
22
namespace TechDivision\Import\Product\Magic360\Actions\Processors;
23
24
use TechDivision\Import\Product\Magic360\Utils\MemberNames;
25
use TechDivision\Import\Actions\Processors\AbstractCreateProcessor;
26
27
/**
28
 * The magic360 columns update processor implementation.
29
 *
30
 * @author    Tim Wagner <[email protected]>
31
 * @author    Bernhard Wick <[email protected]>
32
 * @copyright 2017 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-magic360
35
 * @link      http://www.techdivision.com
36
 */
37 View Code Duplication
class Magic360ColumnsUpdateProcessor extends AbstractCreateProcessor
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
38
{
39
40
    /**
41
     * Returns the array with the SQL statements that has to be prepared.
42
     *
43
     * @return array The SQL statements to be prepared
44
     * @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements()
45
     */
46
    protected function getStatements()
47
    {
48
49
        // load the utility class name
50
        $utilityClassName = $this->getUtilityClassName();
51
52
        // return the array with the SQL statements that has to be prepared
53
        return array(
54
            $utilityClassName::UPDATE_MAGIC360_COLUMNS => $utilityClassName::UPDATE_MAGIC360_COLUMNS
55
        );
56
    }
57
58
    /**
59
     * Persists the passed row.
60
     *
61
     * @param array       $row  The row to persist
62
     * @param string|null $name The name of the prepared statement that has to be executed
63
     *
64
     * @return string The last inserted ID
65
     */
66
    public function execute($row, $name = null)
67
    {
68
        parent::execute($row, $name);
69
        return $row[MemberNames::PRODUCT_ID];
70
    }
71
}
72