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

        // map the entity type code to the ID
        $entityType = $this->getEntityType($this->getValue(ColumnKeys::ENTITY_TYPE_CODE));
        $entityTypeId = $entityType[MemberNames::ENTITY_TYPE_ID];

        // load the data from the row
        $attributeCode = $this->getValue(ColumnKeys::ATTRIBUTE_CODE);
        $attributeModel = $this->getValue(ColumnKeys::ATTRIBUTE_MODEL);
        $backendModel = $this->getValue(ColumnKeys::BACKEND_MODEL);
        $backendType = $this->getValue(ColumnKeys::BACKEND_TYPE, BackendTypeKeys::BACKEND_TYPE_STATIC);
        $backendTable = $this->getValue(ColumnKeys::BACKEND_TABLE);
        $frontendModel = $this->getValue(ColumnKeys::FRONTEND_MODEL);
        $frontendInput = $this->getValue(ColumnKeys::FRONTEND_INPUT);
        $frontendLabel = $this->getValue(ColumnKeys::FRONTEND_LABEL);
        $frontendClass = $this->getValue(ColumnKeys::FRONTEND_CLASS);
        $sourceModel = $this->getValue(ColumnKeys::SOURCE_MODEL);
        $isRequired = $this->getValue(ColumnKeys::IS_REQUIRED, 0);
        $isUserDefined = $this->getValue(ColumnKeys::IS_USER_DEFINED, 1);
        $isUnique = $this->getValue(ColumnKeys::IS_UNIQUE, 0);
        $note = $this->getValue(ColumnKeys::NOTE);

        // return the prepared product
        return $this->initializeEntity(
            array(
                MemberNames::ENTITY_TYPE_ID  => $entityTypeId,
                MemberNames::ATTRIBUTE_CODE  => $attributeCode,
                MemberNames::ATTRIBUTE_MODEL => $attributeModel,
                MemberNames::BACKEND_MODEL   => $backendModel,
                MemberNames::BACKEND_TYPE    => $backendType,
                MemberNames::BACKEND_TABLE   => $backendTable,
                MemberNames::FRONTEND_MODEL  => $frontendModel,
                MemberNames::FRONTEND_INPUT  => $frontendInput,
                MemberNames::FRONTEND_LABEL  => $frontendLabel,
                MemberNames::FRONTEND_CLASS  => $frontendClass,
                MemberNames::SOURCE_MODEL    => $sourceModel,
                MemberNames::IS_REQUIRED     => $isRequired,
                MemberNames::IS_USER_DEFINED => $isUserDefined,
                MemberNames::DEFAULT_VALUE   => null,
                MemberNames::IS_UNIQUE       => $isUnique,
                MemberNames::NOTE            => $note
            )
        );
    }
protected function prepareAttributes()
    {

        // map the entity type code to the ID
        $entityType = $this->getEntityType($this->getValue(ColumnKeys::ENTITY_TYPE_CODE));
        $entityTypeId = $entityType[MemberNames::ENTITY_TYPE_ID];

        // load the data from the row
        $attributeCode = $this->getValue(ColumnKeys::ATTRIBUTE_CODE);
        $attributeModel = $this->getValue(ColumnKeys::ATTRIBUTE_MODEL);
        $backendModel = $this->getValue(ColumnKeys::BACKEND_MODEL);
        $backendType = $this->getValue(ColumnKeys::BACKEND_TYPE, BackendTypeKeys::BACKEND_TYPE_STATIC);
        $backendTable = $this->getValue(ColumnKeys::BACKEND_TABLE);
        $frontendModel = $this->getValue(ColumnKeys::FRONTEND_MODEL);
        $frontendInput = $this->getValue(ColumnKeys::FRONTEND_INPUT);
        $frontendLabel = $this->getValue(ColumnKeys::FRONTEND_LABEL);
        $frontendClass = $this->getValue(ColumnKeys::FRONTEND_CLASS);
        $sourceModel = $this->getValue(ColumnKeys::SOURCE_MODEL);
        $isRequired = $this->getValue(ColumnKeys::IS_REQUIRED, 0);
        $isUserDefined = $this->getValue(ColumnKeys::IS_USER_DEFINED, 1);
        $isUnique = $this->getValue(ColumnKeys::IS_UNIQUE, 0);
        $note = $this->getValue(ColumnKeys::NOTE);

        // return the prepared product
        return $this->initializeEntity(
            array(
                MemberNames::ENTITY_TYPE_ID  => $entityTypeId,
                MemberNames::ATTRIBUTE_CODE  => $attributeCode,
                MemberNames::ATTRIBUTE_MODEL => $attributeModel,
                MemberNames::BACKEND_MODEL   => $backendModel,
                MemberNames::BACKEND_TYPE    => $backendType,
                MemberNames::BACKEND_TABLE   => $backendTable,
                MemberNames::FRONTEND_MODEL  => $frontendModel,
                MemberNames::FRONTEND_INPUT  => $frontendInput,
                MemberNames::FRONTEND_LABEL  => $frontendLabel,
                MemberNames::FRONTEND_CLASS  => $frontendClass,
                MemberNames::SOURCE_MODEL    => $sourceModel,
                MemberNames::IS_REQUIRED     => $isRequired,
                MemberNames::IS_USER_DEFINED => $isUserDefined,
                MemberNames::DEFAULT_VALUE   => null,
                MemberNames::IS_UNIQUE       => $isUnique,
                MemberNames::NOTE            => $note
            )
        );
    }
Prepare the attributes of the entity that has to be persisted.

@return array The prepared attributes