Mage_Customer_Model_Customer_Attribute_Backend_Shipping Class Reference

Inheritance diagram for Mage_Customer_Model_Customer_Attribute_Backend_Shipping:

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 Shipping.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 Shipping.php.

00045     {
00046         if ($defaultShipping = $object->getDefaultShipping()) 
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() == $defaultShipping) {
00055                     $addressId = $address->getId();
00056                 }
00057             }
00058             
00059             if ($addressId) {
00060                 $object->setDefaultShipping($addressId);
00061                 $this->getAttribute()->getEntity()
00062                     ->saveAttribute($object, $this->getAttribute()->getAttributeCode());
00063             }
00064         }
00065     }

beforeSave ( object  ) 

Reimplemented from Mage_Eav_Model_Entity_Attribute_Backend_Abstract.

Definition at line 36 of file Shipping.php.

00037     {
00038         $defaultShipping = $object->getDefaultShipping();
00039         if (is_null($defaultShipping)) {
00040             $object->unsetDefaultShipping();
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