Magic360GalleryUpdateProcessor::getStatements()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Magic360\Actions\Processors\Magic360GalleryUpdateProcessor
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\Product\Magic360\Utils\SqlStatementKeys;
26
use TechDivision\Import\Actions\Processors\AbstractCreateProcessor;
27
28
/**
29
 * The magic360 columns update processor implementation.
30
 *
31
 * @author    Tim Wagner <[email protected]>
32
 * @author    Bernhard Wick <[email protected]>
33
 * @copyright 2017 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-magic360
36
 * @link      http://www.techdivision.com
37
 */
38 View Code Duplication
class Magic360GalleryUpdateProcessor 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...
39
{
40
41
    /**
42
     * Returns the array with the SQL statements that has to be prepared.
43
     *
44
     * @return array The SQL statements to be prepared
45
     * @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements()
46
     */
47
    protected function getStatements()
48
    {
49
50
        // return the array with the SQL statements that has to be prepared
51
        return array(
52
            SqlStatementKeys::UPDATE_MAGIC360_GALLERY => $this->loadStatement(SqlStatementKeys::UPDATE_MAGIC360_GALLERY)
53
        );
54
    }
55
56
    /**
57
     * Persists the passed row.
58
     *
59
     * @param array       $row  The row to persist
60
     * @param string|null $name The name of the prepared statement that has to be executed
61
     *
62
     * @return string The last inserted ID
63
     */
64
    public function execute($row, $name = null)
65
    {
66
        parent::execute($row, $name);
67
        return $row[MemberNames::PRODUCT_ID];
68
    }
69
}
70