src/Observers/EntityAttributeObserver.php
protected function prepareAttributes()
    {

        // load the attribute group ID
        $attributeGroup = $this->getAttributeGroupByEntityTypeCodeAndAttributeSetNameAndAttributeGroupName(
            $this->entityTypeCode,
            $this->attributeSetName,
            $this->attributeGroupName
        );

        // load the attribute group ID
        $attributeGroupId = $attributeGroup[MemberNames::ATTRIBUTE_GROUP_ID];

        // return the prepared product
        return $this->initializeEntity(
            array(
                MemberNames::ATTRIBUTE_ID       => $this->attributeId,
                MemberNames::ENTITY_TYPE_ID     => $this->entityTypeId,
                MemberNames::ATTRIBUTE_SET_ID   => $this->attributeSetId,
                MemberNames::SORT_ORDER         => $this->sortOrder,
                MemberNames::ATTRIBUTE_GROUP_ID => $attributeGroupId
            )
        );
    }
protected function prepareAttributes()
    {

        // load the attribute group ID
        $attributeGroup = $this->getAttributeGroupByEntityTypeCodeAndAttributeSetNameAndAttributeGroupName(
            $this->entityTypeCode,
            $this->attributeSetName,
            $this->attributeGroupName
        );

        // load the attribute group ID
        $attributeGroupId = $attributeGroup[MemberNames::ATTRIBUTE_GROUP_ID];

        // return the prepared product
        return $this->initializeEntity(
            array(
                MemberNames::ATTRIBUTE_ID       => $this->attributeId,
                MemberNames::ENTITY_TYPE_ID     => $this->entityTypeId,
                MemberNames::ATTRIBUTE_SET_ID   => $this->attributeSetId,
                MemberNames::SORT_ORDER         => $this->sortOrder,
                MemberNames::ATTRIBUTE_GROUP_ID => $attributeGroupId
            )
        );
    }
Prepare the attributes of the entity that has to be persisted.

@return array The prepared attributes