Code Duplication    Length = 35-35 lines in 2 locations

src/Actions/Processors/ProductBundleOptionUpdateProcessor.php 1 location

@@ 35-69 (lines=35) @@
32
 * @link      https://github.com/techdivision/import-product-bundle
33
 * @link      http://www.techdivision.com
34
 */
35
class ProductBundleOptionUpdateProcessor 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
        // load the utility class name
48
        $utilityClassName = $this->getUtilityClassName();
49
50
        // return the array with the SQL statements that has to be prepared
51
        return array(
52
            $utilityClassName::UPDATE_PRODUCT_BUNDLE_OPTION => $utilityClassName::UPDATE_PRODUCT_BUNDLE_OPTION
53
        );
54
    }
55
56
    /**
57
     * Update's the passed row.
58
     *
59
     * @param array       $row  The row to update
60
     * @param string|null $name The name of the prepared statement that has to be executed
61
     *
62
     * @return string The ID of the updated product
63
     */
64
    public function execute($row, $name = null)
65
    {
66
        parent::execute($row, $name);
67
        return $row[MemberNames::OPTION_ID];
68
    }
69
}
70

src/Actions/Processors/ProductBundleSelectionUpdateProcessor.php 1 location

@@ 35-69 (lines=35) @@
32
 * @link      https://github.com/techdivision/import-product-bundle
33
 * @link      http://www.techdivision.com
34
 */
35
class ProductBundleSelectionUpdateProcessor 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
        // load the utility class name
48
        $utilityClassName = $this->getUtilityClassName();
49
50
        // return the array with the SQL statements that has to be prepared
51
        return array(
52
            $utilityClassName::UPDATE_PRODUCT_BUNDLE_SELECTION => $utilityClassName::UPDATE_PRODUCT_BUNDLE_SELECTION
53
        );
54
    }
55
56
    /**
57
     * Persist's 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::SELECTION_ID];
68
    }
69
}
70