Code Duplication    Length = 35-35 lines in 2 locations

src/Actions/Processors/AttributeOptionUpdateProcessor.php 1 location

@@ 35-69 (lines=35) @@
32
 * @link      https://github.com/techdivision/import-attribute
33
 * @link      http://www.techdivision.com
34
 */
35
class AttributeOptionUpdateProcessor 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_ATTRIBUTE_OPTION => $utilityClassName::UPDATE_ATTRIBUTE_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 attribute
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/AttributeUpdateProcessor.php 1 location

@@ 35-69 (lines=35) @@
32
 * @link      https://github.com/techdivision/import-attribute
33
 * @link      http://www.techdivision.com
34
 */
35
class AttributeUpdateProcessor 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_ATTRIBUTE => $utilityClassName::UPDATE_ATTRIBUTE
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 attribute
63
     */
64
    public function execute($row, $name = null)
65
    {
66
        parent::execute($row, $name);
67
        return $row[MemberNames::ATTRIBUTE_ID];
68
    }
69
}
70