Code Duplication    Length = 32-32 lines in 2 locations

src/Actions/Processors/ProductCreateProcessor.php 1 location

@@ 35-66 (lines=32) @@
32
 * @link      https://github.com/techdivision/import-product
33
 * @link      http://www.techdivision.com
34
 */
35
class ProductCreateProcessor extends AbstractCreateProcessor
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::CREATE_PRODUCT => $this->loadStatement(SqlStatementKeys::CREATE_PRODUCT)
50
        );
51
    }
52
53
    /**
54
     * Persist'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
     *
59
     * @return string The last inserted ID
60
     */
61
    public function execute($row, $name = null)
62
    {
63
        parent::execute($row, $name);
64
        return $this->getConnection()->lastInsertId();
65
    }
66
}
67

src/Actions/Processors/ProductVarcharCreateProcessor.php 1 location

@@ 35-66 (lines=32) @@
32
 * @link      https://github.com/techdivision/import-product
33
 * @link      http://www.techdivision.com
34
 */
35
class ProductVarcharCreateProcessor extends AbstractCreateProcessor
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::CREATE_PRODUCT_VARCHAR => $this->loadStatement(SqlStatementKeys::CREATE_PRODUCT_VARCHAR)
50
        );
51
    }
52
53
    /**
54
     * Persist'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
     *
59
     * @return string The last inserted ID
60
     */
61
    public function execute($row, $name = null)
62
    {
63
        parent::execute($row, $name);
64
        return $this->getConnection()->lastInsertId();
65
    }
66
}
67