Mage_Adminhtml_Model_Session_Quote Class Reference

Inheritance diagram for Mage_Adminhtml_Model_Session_Quote:

Mage_Core_Model_Session_Abstract Mage_Core_Model_Session_Abstract_Varien Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getQuote ()
 getCustomer ()
 getStore ()
 getOrder ()

Public Attributes

const XML_PATH_DEFAULT_CREATEACCOUNT_GROUP = 'customer/create_account/default_group'

Protected Attributes

 $_quote = null
 $_customer = null
 $_store = null
 $_order = null


Detailed Description

Definition at line 34 of file Quote.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 66 of file Quote.php.

00067     {
00068         $this->init('adminhtml_quote');
00069         if (Mage::app()->isSingleStoreMode()) {
00070             $this->setStoreId(Mage::app()->getStore(true)->getId());
00071         }
00072     }


Member Function Documentation

getCustomer (  ) 

Retrieve customer model object

Returns:
Mage_Customer_Model_Customer

Definition at line 106 of file Quote.php.

00107     {
00108         if (is_null($this->_customer)) {
00109             $this->_customer = Mage::getModel('customer/customer');
00110             if ($customerId = $this->getCustomerId()) {
00111                 $this->_customer->load($customerId);
00112             }
00113         }
00114         return $this->_customer;
00115     }

getOrder (  ) 

Retrieve order model object

Returns:
Mage_Sales_Model_Order

Definition at line 138 of file Quote.php.

00139     {
00140         if (is_null($this->_order)) {
00141             $this->_order = Mage::getModel('sales/order');
00142             if ($this->getOrderId()) {
00143                 $this->_order->load($this->getOrderId());
00144             }
00145         }
00146         return $this->_order;
00147     }

getQuote (  ) 

Retrieve quote model object

Returns:
Mage_Sales_Model_Quote

Definition at line 79 of file Quote.php.

00080     {
00081         if (is_null($this->_quote)) {
00082             $this->_quote = Mage::getModel('sales/quote');
00083             if ($this->getStoreId() && $this->getQuoteId()) {
00084                 $this->_quote->setStoreId($this->getStoreId())
00085                     ->load($this->getQuoteId());
00086             }
00087             elseif($this->getStoreId() && $this->hasCustomerId()) {
00088                 $this->_quote->setStoreId($this->getStoreId())
00089                     ->setCustomerGroupId(Mage::getStoreConfig(self::XML_PATH_DEFAULT_CREATEACCOUNT_GROUP))
00090                     ->assignCustomer($this->getCustomer())
00091                     ->setIsActive(false)
00092                     ->save();
00093                 $this->setQuoteId($this->_quote->getId());
00094             }
00095             $this->_quote->setIgnoreOldQty(true);
00096             $this->_quote->setIsSuperMode(true);
00097         }
00098         return $this->_quote;
00099     }

getStore (  ) 

Retrieve store model object

Returns:
Mage_Core_Model_Store

Definition at line 122 of file Quote.php.

00123     {
00124         if (is_null($this->_store)) {
00125             $this->_store = Mage::app()->getStore($this->getStoreId());
00126             if ($currencyId = $this->getCurrencyId()) {
00127                 $this->_store->setCurrentCurrencyCode($currencyId);
00128             }
00129         }
00130         return $this->_store;
00131     }


Member Data Documentation

$_customer = null [protected]

Definition at line 50 of file Quote.php.

$_order = null [protected]

Definition at line 64 of file Quote.php.

$_quote = null [protected]

Definition at line 43 of file Quote.php.

$_store = null [protected]

Definition at line 57 of file Quote.php.

const XML_PATH_DEFAULT_CREATEACCOUNT_GROUP = 'customer/create_account/default_group'

Definition at line 36 of file Quote.php.


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

Generated on Sat Jul 4 17:23:13 2009 for Magento by  doxygen 1.5.8