Code Duplication    Length = 33-33 lines in 2 locations

src/Actions/Processors/ProductBundleOptionCreateProcessor.php 1 location

@@ 36-68 (lines=33) @@
33
 * @link      https://github.com/techdivision/import-product-bundle-ee
34
 * @link      http://www.techdivision.com
35
 */
36
class ProductBundleOptionCreateProcessor extends AbstractCreateProcessor
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::CREATE_PRODUCT_BUNDLE_OPTION => $this->loadStatement(SqlStatementKeys::CREATE_PRODUCT_BUNDLE_OPTION)
51
        );
52
    }
53
54
    /**
55
     * Persist'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 last inserted ID
62
     */
63
    public function execute($row, $name = null, $primaryKeyMemberName = null)
64
    {
65
        parent::execute($row, $name);
66
        return $row[MemberNames::OPTION_ID];
67
    }
68
}
69

src/Actions/Processors/ProductBundleSelectionCreateProcessor.php 1 location

@@ 36-68 (lines=33) @@
33
 * @link      https://github.com/techdivision/import-product-bundle-ee
34
 * @link      http://www.techdivision.com
35
 */
36
class ProductBundleSelectionCreateProcessor extends AbstractCreateProcessor
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::CREATE_PRODUCT_BUNDLE_SELECTION => $this->loadStatement(SqlStatementKeys::CREATE_PRODUCT_BUNDLE_SELECTION)
51
        );
52
    }
53
54
    /**
55
     * Persist'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 last inserted ID
62
     */
63
    public function execute($row, $name = null, $primaryKeyMemberName = null)
64
    {
65
        parent::execute($row, $name);
66
        return $row[MemberNames::SELECTION_ID];
67
    }
68
}
69