src/Observers/AttributeDefaultOptionObserver.php
protected function process()
    {

        // load the default value we want to set
        $defaultValue = $this->getValue(ColumnKeys::DEFAULT_VALUE);

        // load the entity type ID for the value from the system configuration
        $entityTypeId = $this->getEntityTypeId();

        // initialize the data to load the EAV attribute option
        $storeId = $this->getRowStoreId(StoreViewCodes::ADMIN);
        $attributeCode = $this->getValue(ColumnKeys::ATTRIBUTE_CODE);

        // try to load the EAV attribute option
        if ($attributeOption = $this->loadAttributeOptionByEntityTypeIdAndAttributeCodeAndStoreIdAndValue($entityTypeId, $attributeCode, $storeId, $defaultValue)) {
            // load the EAV attribute with the actual code
            $attribute = $this->loadAttributeByEntityTypeIdAndAttributeCode($entityTypeId, $attributeCode);
            // set the default value with the EAV attribute option ID and update the attribute
            $this->persistAttribute($this->mergeEntity($attribute, array(MemberNames::DEFAULT_VALUE => $attributeOption[MemberNames::OPTION_ID])));
        }
    }
protected function process()
    {

        // load the default value we want to set
        $defaultValue = $this->getValue(ColumnKeys::DEFAULT_VALUE);

        // load the entity type ID for the value from the system configuration
        $entityTypeId = $this->getEntityTypeId();

        // initialize the data to load the EAV attribute option
        $storeId = $this->getRowStoreId(StoreViewCodes::ADMIN);
        $attributeCode = $this->getValue(ColumnKeys::ATTRIBUTE_CODE);

        // try to load the EAV attribute option
        if ($attributeOption = $this->loadAttributeOptionByEntityTypeIdAndAttributeCodeAndStoreIdAndValue($entityTypeId, $attributeCode, $storeId, $defaultValue)) {
            // load the EAV attribute with the actual code
            $attribute = $this->loadAttributeByEntityTypeIdAndAttributeCode($entityTypeId, $attributeCode);
            // set the default value with the EAV attribute option ID and update the attribute
            $this->persistAttribute($this->mergeEntity($attribute, array(MemberNames::DEFAULT_VALUE => $attributeOption[MemberNames::OPTION_ID])));
        }
    }
Process the observer's business logic.

@return void