Mage_Sales_Model_Quote_Address_Item Class Reference

Inheritance diagram for Mage_Sales_Model_Quote_Address_Item:

Mage_Sales_Model_Quote_Item_Abstract Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 setAddress (Mage_Sales_Model_Quote_Address $address)
 getAddress ()
 getQuote ()
 importQuoteItem (Mage_Sales_Model_Quote_Item $quoteItem)
 getOptionBycode ($code)

Protected Member Functions

 _construct ()
 _beforeSave ()

Protected Attributes

 $_address
 $_quote


Detailed Description

Definition at line 28 of file Item.php.


Member Function Documentation

_beforeSave (  )  [protected]

Processing object before save data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Sales_Model_Quote_Item_Abstract.

Definition at line 43 of file Item.php.

00044     {
00045         parent::_beforeSave();
00046         if ($this->getAddress()) {
00047             $this->setQuoteAddressId($this->getAddress()->getId());
00048         }
00049         return $this;
00050     }

_construct (  )  [protected]

Enter description here...

Reimplemented from Varien_Object.

Definition at line 38 of file Item.php.

00039     {
00040         $this->_init('sales/quote_address_item');
00041     }

getAddress (  ) 

Retrieve address model

Returns:
Mage_Sales_Model_Quote_Address

Definition at line 70 of file Item.php.

00071     {
00072         return $this->_address;
00073     }

getOptionBycode ( code  ) 

Definition at line 107 of file Item.php.

00108     {
00109         if ($this->getQuoteItem()) {
00110             return $this->getQuoteItem()->getOptionBycode($code);
00111         }
00112         return null;
00113     }

getQuote (  ) 

Retrieve quote model instance

Returns:
Mage_Sales_Model_Quote

Reimplemented from Mage_Sales_Model_Quote_Item_Abstract.

Definition at line 80 of file Item.php.

00081     {
00082         return $this->_quote;
00083     }

importQuoteItem ( Mage_Sales_Model_Quote_Item quoteItem  ) 

Definition at line 86 of file Item.php.

00087     {
00088         $this->_quote = $quoteItem->getQuote();
00089         $this->setQuoteItem($quoteItem)
00090             ->setQuoteItemId($quoteItem->getId())
00091             ->setProductId($quoteItem->getProductId())
00092             ->setProduct($quoteItem->getProduct())
00093             ->setSku($quoteItem->getSku())
00094             ->setName($quoteItem->getName())
00095             ->setDescription($quoteItem->getDescription())
00096             ->setWeight($quoteItem->getWeight())
00097             ->setPrice($quoteItem->getPrice())
00098             ->setCost($quoteItem->getCost());
00099 
00100         if (!$this->hasQty()) {
00101             $this->setQty($quoteItem->getQty());
00102         }
00103         $this->setQuoteItemImported(true);
00104         return $this;
00105     }

setAddress ( Mage_Sales_Model_Quote_Address address  ) 

Declare address model

Parameters:
Mage_Sales_Model_Quote_Address $address
Returns:
Mage_Sales_Model_Quote_Address_Item

Definition at line 58 of file Item.php.

00059     {
00060         $this->_address = $address;
00061         $this->_quote   = $address->getQuote();
00062         return $this;
00063     }


Member Data Documentation

$_address [protected]

Definition at line 35 of file Item.php.

$_quote [protected]

Definition at line 36 of file Item.php.


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

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