Mage_Customer_Model_Customer_Attribute_Backend_Billing Class Reference

Inheritance diagram for Mage_Customer_Model_Customer_Attribute_Backend_Billing:

Mage_Eav_Model_Entity_Attribute_Backend_Abstract Mage_Eav_Model_Entity_Attribute_Backend_Interface

List of all members.

Public Member Functions

 beforeSave ($object)
 afterSave ($object)


Detailed Description

Definition at line 34 of file Billing.php.


Member Function Documentation

afterSave ( object  ) 

post_index set in customer save action for address this is $_POST array index for address

Reimplemented from Mage_Eav_Model_Entity_Attribute_Backend_Abstract.

Definition at line 44 of file Billing.php.

00045     {
00046         if ($defaultBilling = $object->getDefaultBilling()) 
00047         {
00048             $addressId = false;
00049             /**
00050              * post_index set in customer save action for address
00051              * this is $_POST array index for address
00052              */
00053             foreach ($object->getAddresses() as $address) {
00054                 if ($address->getPostIndex() == $defaultBilling) {
00055                     $addressId = $address->getId();
00056                 }
00057             }
00058             if ($addressId) {
00059                 $object->setDefaultBilling($addressId);
00060                 $this->getAttribute()->getEntity()
00061                     ->saveAttribute($object, $this->getAttribute()->getAttributeCode());
00062             }
00063         }
00064     }

beforeSave ( object  ) 

Reimplemented from Mage_Eav_Model_Entity_Attribute_Backend_Abstract.

Definition at line 36 of file Billing.php.

00037     {
00038         $defaultBilling = $object->getDefaultBilling();
00039         if (is_null($defaultBilling)) {
00040             $object->unsetDefaultBilling();
00041         }
00042     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:04 2009 for Magento by  doxygen 1.5.8