Code Duplication    Length = 14-17 lines in 2 locations

src/Observers/AttributeOptionObserver.php 1 location

@@ 117-130 (lines=14) @@
114
     *
115
     * @return array The prepared attributes
116
     */
117
    protected function prepareAttributes()
118
    {
119
120
        // load the attribute ID
121
        $attribute = $this->loadAttributeByEntityTypeIdAndAttributeCode($this->getEntityTypeId(), $this->getValue(ColumnKeys::ATTRIBUTE_CODE));
122
        $attributeId = $attribute[MemberNames::ATTRIBUTE_ID];
123
124
        // return the prepared attribute option
125
        return $this->initializeEntity(
126
            $this->loadRawEntity(
127
                array(MemberNames::ATTRIBUTE_ID => $attributeId)
128
            )
129
        );
130
    }
131
132
    /**
133
     * Load's and return's a raw customer entity without primary key but the mandatory members only and nulled values.

src/Observers/ClearAttributeObserver.php 1 location

@@ 61-77 (lines=17) @@
58
     *
59
     * @return array The processed row
60
     */
61
    protected function process()
62
    {
63
64
        // query whether or not, we've found a new EAV attribute code => means we've found a new attribute
65
        if ($this->hasBeenProcessed($attributeCode = $this->getValue(ColumnKeys::ATTRIBUTE_CODE))) {
66
            return;
67
        }
68
69
        // try to load the EAV attribute with the code found in the CSV file
70
        $attribute = $this->loadAttributeByEntityTypeIdAndAttributeCode($this->getEntityTypeId(), $attributeCode);
71
72
        // delete the EAV attribute with the code found in the CSV file
73
        $this->deleteAttribute(array(MemberNames::ATTRIBUTE_ID => $attribute[MemberNames::ATTRIBUTE_ID]));
74
75
        // temporary persist the ID of the deleted attribute
76
        $this->setLastAttributeId($attribute[MemberNames::ATTRIBUTE_ID]);
77
    }
78
79
    /**
80
     * Return's the attribute bunch processor instance.