예제 #1
0
 /**
  * Retrieve Customer instance
  *
  * @return Mage_Customer_Model_Customer
  */
 protected function _getCustomer()
 {
     if (is_null($this->_customer)) {
         $this->_customer = Mage::getModel('customer/customer');
         $params = Mage::helper('core')->urlDecode($this->getRequest()->getParam('data'));
         $data = explode(',', $params);
         $cId = abs(intval($data[0]));
         if ($cId && $cId == Mage::getSingleton('customer/session')->getCustomerId()) {
             $this->_customer->load($cId);
         }
     }
     return $this->_customer;
 }
예제 #2
0
 protected function setUp()
 {
     $customer = new Mage_Customer_Model_Customer();
     $customer->load(1);
     Mage::register('current_customer', $customer);
     $layout = new Mage_Core_Model_Layout(array('area' => 'adminhtml'));
     $this->_block = $layout->createBlock('Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion');
 }
예제 #3
0
 /**
  * Retrieve customer model object
  *
  * @return Mage_Customer_Model_Customer
  */
 public function getCustomer()
 {
     if (is_null($this->_customer)) {
         $this->_customer = Mage::getModel('customer/customer');
         if ($customerId = $this->getCustomerId()) {
             $this->_customer->load($customerId);
         }
     }
     return $this->_customer;
 }
예제 #4
0
 /**
  * Retrieve customer model object
  * @param bool $forceReload
  * @param bool $useSetStore
  * @return Mage_Customer_Model_Customer
  */
 public function getCustomer($forceReload = false, $useSetStore = false)
 {
     if (is_null($this->_customer) || $forceReload) {
         $this->_customer = Mage::getModel('customer/customer');
         if ($useSetStore && $this->getStore()->getId()) {
             $this->_customer->setStore($this->getStore());
         }
         if ($customerId = $this->getCustomerId()) {
             $this->_customer->load($customerId);
         }
     }
     return $this->_customer;
 }
예제 #5
0
파일: Quote.php 프로젝트: relue/magento2
 /**
  * Retrieve customer model object
  *
  * @return Mage_Customer_Model_Customer
  */
 public function getCustomer()
 {
     if (is_null($this->_customer)) {
         $this->_customer = Mage::getModel('Mage_Customer_Model_Customer');
         if ($customerId = $this->getCustomerId()) {
             $this->_customer->load($customerId);
             if (!$this->_customer->getId()) {
                 $this->_customer->setCustomerId(null);
             }
         }
     }
     return $this->_customer;
 }