Code Duplication    Length = 33-33 lines in 6 locations

src/Actions/Processors/ProductCreateProcessor.php 1 location

@@ 35-67 (lines=33) @@
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
     * @param string|null $primaryKeyMemberName The primary key member name of the entity to use
59
     *
60
     * @return string The last inserted ID
61
     */
62
    public function execute($row, $name = null, $primaryKeyMemberName = null)
63
    {
64
        parent::execute($row, $name);
65
        return $this->getConnection()->lastInsertId();
66
    }
67
}
68

src/Actions/Processors/ProductDatetimeCreateProcessor.php 1 location

@@ 35-67 (lines=33) @@
32
 * @link      https://github.com/techdivision/import-product
33
 * @link      http://www.techdivision.com
34
 */
35
class ProductDatetimeCreateProcessor 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_DATETIME => $this->loadStatement(SqlStatementKeys::CREATE_PRODUCT_DATETIME)
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
     * @param string|null $primaryKeyMemberName The primary key member name of the entity to use
59
     *
60
     * @return string The last inserted ID
61
     */
62
    public function execute($row, $name = null, $primaryKeyMemberName = null)
63
    {
64
        parent::execute($row, $name);
65
        return $this->getConnection()->lastInsertId();
66
    }
67
}
68

src/Actions/Processors/ProductDecimalCreateProcessor.php 1 location

@@ 35-67 (lines=33) @@
32
 * @link      https://github.com/techdivision/import-product
33
 * @link      http://www.techdivision.com
34
 */
35
class ProductDecimalCreateProcessor 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_DECIMAL => $this->loadStatement(SqlStatementKeys::CREATE_PRODUCT_DECIMAL)
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
     * @param string|null $primaryKeyMemberName The primary key member name of the entity to use
59
     *
60
     * @return string The last inserted ID
61
     */
62
    public function execute($row, $name = null, $primaryKeyMemberName = null)
63
    {
64
        parent::execute($row, $name);
65
        return $this->getConnection()->lastInsertId();
66
    }
67
}
68

src/Actions/Processors/ProductIntCreateProcessor.php 1 location

@@ 35-67 (lines=33) @@
32
 * @link      https://github.com/techdivision/import-product
33
 * @link      http://www.techdivision.com
34
 */
35
class ProductIntCreateProcessor 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_INT => $this->loadStatement(SqlStatementKeys::CREATE_PRODUCT_INT)
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
     * @param string|null $primaryKeyMemberName The primary key member name of the entity to use
59
     *
60
     * @return string The last inserted ID
61
     */
62
    public function execute($row, $name = null, $primaryKeyMemberName = null)
63
    {
64
        parent::execute($row, $name);
65
        return $this->getConnection()->lastInsertId();
66
    }
67
}
68

src/Actions/Processors/ProductTextCreateProcessor.php 1 location

@@ 35-67 (lines=33) @@
32
 * @link      https://github.com/techdivision/import-product
33
 * @link      http://www.techdivision.com
34
 */
35
class ProductTextCreateProcessor 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_TEXT => $this->loadStatement(SqlStatementKeys::CREATE_PRODUCT_TEXT)
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
     * @param string|null $primaryKeyMemberName The primary key member name of the entity to use
59
     *
60
     * @return string The last inserted ID
61
     */
62
    public function execute($row, $name = null, $primaryKeyMemberName = null)
63
    {
64
        parent::execute($row, $name);
65
        return $this->getConnection()->lastInsertId();
66
    }
67
}
68

src/Actions/Processors/ProductVarcharCreateProcessor.php 1 location

@@ 35-67 (lines=33) @@
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
     * @param string|null $primaryKeyMemberName The primary key member name of the entity to use
59
     *
60
     * @return string The last inserted ID
61
     */
62
    public function execute($row, $name = null, $primaryKeyMemberName = null)
63
    {
64
        parent::execute($row, $name);
65
        return $this->getConnection()->lastInsertId();
66
    }
67
}
68