Code Duplication    Length = 32-32 lines in 2 locations

src/Actions/Processors/ProductUpdateProcessor.php 1 location

@@ 36-67 (lines=32) @@
33
 * @link      https://github.com/techdivision/import-product
34
 * @link      http://www.techdivision.com
35
 */
36
class ProductUpdateProcessor extends AbstractUpdateProcessor
37
{
38
39
    /**
40
     * Return's the array with the SQL statements that has to be prepared.
41
     *
42
     * @return array The SQL statements to be prepared
43
     * @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements()
44
     */
45
    protected function getStatements()
46
    {
47
48
        // return the array with the SQL statements that has to be prepared
49
        return array(
50
            SqlStatementKeys::UPDATE_PRODUCT => $this->loadStatement(SqlStatementKeys::UPDATE_PRODUCT)
51
        );
52
    }
53
54
    /**
55
     * Update's the passed row.
56
     *
57
     * @param array       $row  The row to update
58
     * @param string|null $name The name of the prepared statement that has to be executed
59
     *
60
     * @return string The ID of the updated product
61
     */
62
    public function execute($row, $name = null)
63
    {
64
        parent::execute($row, $name);
65
        return $row[MemberNames::ENTITY_ID];
66
    }
67
}
68

src/Actions/Processors/ProductVarcharUpdateProcessor.php 1 location

@@ 36-67 (lines=32) @@
33
 * @link      https://github.com/techdivision/import-product
34
 * @link      http://www.techdivision.com
35
 */
36
class ProductVarcharUpdateProcessor extends AbstractUpdateProcessor
37
{
38
39
    /**
40
     * Return's the array with the SQL statements that has to be prepared.
41
     *
42
     * @return array The SQL statements to be prepared
43
     * @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements()
44
     */
45
    protected function getStatements()
46
    {
47
48
        // return the array with the SQL statements that has to be prepared
49
        return array(
50
            SqlStatementKeys::UPDATE_PRODUCT_VARCHAR => $this->loadStatement(SqlStatementKeys::UPDATE_PRODUCT_VARCHAR)
51
        );
52
    }
53
54
    /**
55
     * Update's the passed row.
56
     *
57
     * @param array       $row  The row to update
58
     * @param string|null $name The name of the prepared statement that has to be executed
59
     *
60
     * @return string The ID of the updated product
61
     */
62
    public function execute($row, $name = null)
63
    {
64
        parent::execute($row, $name);
65
        return $row[MemberNames::VALUE_ID];
66
    }
67
}
68