Code Duplication    Length = 31-32 lines in 3 locations

src/Actions/Processors/Magic360ColumnsUpdateProcessor.php 1 location

@@ 38-68 (lines=31) @@
35
 * @link      https://github.com/techdivision/import-product-magic360
36
 * @link      http://www.techdivision.com
37
 */
38
class Magic360ColumnsUpdateProcessor extends AbstractCreateProcessor
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
        // return the array with the SQL statements that has to be prepared
50
        return array(
51
            SqlStatementKeys::UPDATE_MAGIC360_COLUMNS => $this->loadStatement(SqlStatementKeys::UPDATE_MAGIC360_COLUMNS)
52
        );
53
    }
54
55
    /**
56
     * Persists the passed row.
57
     *
58
     * @param array       $row  The row to persist
59
     * @param string|null $name The name of the prepared statement that has to be executed
60
     *
61
     * @return string The last inserted ID
62
     */
63
    public function execute($row, $name = null)
64
    {
65
        parent::execute($row, $name);
66
        return $row[MemberNames::PRODUCT_ID];
67
    }
68
}
69

src/Actions/Processors/Magic360GalleryCreateProcessor.php 1 location

@@ 37-68 (lines=32) @@
34
 * @link      https://github.com/techdivision/import-product-magic360
35
 * @link      http://www.techdivision.com
36
 */
37
class Magic360GalleryCreateProcessor extends AbstractCreateProcessor
38
{
39
40
    /**
41
     * Returns the array with the SQL statements that has to be prepared.
42
     *
43
     * @return array The SQL statements to be prepared
44
     * @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements()
45
     */
46
    protected function getStatements()
47
    {
48
49
        // return the array with the SQL statements that has to be prepared
50
        return array(
51
            SqlStatementKeys::CREATE_MAGIC360_GALLERY => $this->loadStatement(SqlStatementKeys::CREATE_MAGIC360_GALLERY)
52
        );
53
    }
54
55
    /**
56
     * Persists the passed row.
57
     *
58
     * @param array       $row  The row to persist
59
     * @param string|null $name The name of the prepared statement that has to be executed
60
     *
61
     * @return string The last inserted ID
62
     */
63
    public function execute($row, $name = null)
64
    {
65
        parent::execute($row, $name);
66
        return $this->getConnection()->lastInsertId();
67
    }
68
}
69

src/Actions/Processors/Magic360GalleryUpdateProcessor.php 1 location

@@ 38-69 (lines=32) @@
35
 * @link      https://github.com/techdivision/import-product-magic360
36
 * @link      http://www.techdivision.com
37
 */
38
class Magic360GalleryUpdateProcessor extends AbstractCreateProcessor
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