Code Duplication    Length = 33-33 lines in 6 locations

src/Actions/Processors/ProductDatetimeUpdateProcessor.php 1 location

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

src/Actions/Processors/ProductDecimalUpdateProcessor.php 1 location

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

src/Actions/Processors/ProductIntUpdateProcessor.php 1 location

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

src/Actions/Processors/ProductTextUpdateProcessor.php 1 location

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

src/Actions/Processors/ProductUpdateProcessor.php 1 location

@@ 36-68 (lines=33) @@
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 persist
58
     * @param string|null $name                 The name of the prepared statement that has to be executed
59
     * @param string|null $primaryKeyMemberName The primary key member name of the entity to use
60
     *
61
     * @return string The ID of the updated entity
62
     */
63
    public function execute($row, $name = null, $primaryKeyMemberName = null)
64
    {
65
        parent::execute($row, $name);
66
        return $row[MemberNames::ENTITY_ID];
67
    }
68
}
69

src/Actions/Processors/ProductVarcharUpdateProcessor.php 1 location

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