当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Customer_Model_Customer::getSharingConfig方法代码示例

本文整理汇总了PHP中Mage_Customer_Model_Customer::getSharingConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Customer_Model_Customer::getSharingConfig方法的具体用法?PHP Mage_Customer_Model_Customer::getSharingConfig怎么用?PHP Mage_Customer_Model_Customer::getSharingConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Customer_Model_Customer的用法示例。


在下文中一共展示了Mage_Customer_Model_Customer::getSharingConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadByEmail

 public function loadByEmail(Mage_Customer_Model_Customer $customer, $email, $testOnly = false)
 {
     $select = $this->_getReadAdapter()->select()->from($this->getEntityTable(), array($this->getEntityIdField()))->where('email=?', $email);
     if ($customer->getSharingConfig()->isWebsiteScope()) {
         $select->where('website_id=?', (int) $customer->getWebsiteId());
     }
     if ($id = $this->_getReadAdapter()->fetchOne($select)) {
         $this->load($customer, $id);
     }
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:11,代码来源:Customer.php

示例2: loadByUsername

 /**
  * Load customer by username
  *
  * @param Mage_Customer_Model_Customer $customer
  * @param string $username
  * @return Mage_Customer_Model_Entity_Customer
  * @throws Mage_Core_Exception
  */
 public function loadByUsername(Mage_Customer_Model_Customer $customer, $username)
 {
     if (!Mage::getStoreConfigFlag('username/general/case_sensitive')) {
         $filter = new Zend_Filter_StringToLower(array('encoding' => 'UTF-8'));
         $username = $filter->filter($username);
     }
     $select = $this->_getReadAdapter()->select()->from($this->getEntityTable(), array($this->getEntityIdField()))->joinNatural(array('cev' => $this->getTable('customer_entity_varchar')))->joinNatural(array('ea' => $this->getTable('eav/attribute')))->where('ea.attribute_code=\'username\' AND cev.value=?', $username);
     if ($customer->getSharingConfig()->isWebsiteScope()) {
         if (!$customer->hasData('website_id')) {
             Mage::throwException(Mage::helper('customer')->__('Customer website ID must be specified when using the website scope.'));
         }
         $select->where('website_id=?', (int) $customer->getWebsiteId());
     }
     if ($id = $this->_getReadAdapter()->fetchOne($select, 'entity_id')) {
         $this->load($customer, $id);
     } else {
         $customer->setData(array());
     }
     return $this;
 }
开发者ID:versedi,项目名称:Diglin_Username,代码行数:28,代码来源:Customer.php

示例3: loadByEmail

 /**
  * Load customer by email
  *
  * @throws Mage_Core_Exception
  *
  * @param Mage_Customer_Model_Customer $customer
  * @param string $email
  * @param bool $testOnly
  * @return Mage_Customer_Model_Resource_Customer
  */
 public function loadByEmail(Mage_Customer_Model_Customer $customer, $email, $testOnly = false)
 {
     $adapter = $this->_getReadAdapter();
     $bind = array('customer_email' => $email);
     $select = $adapter->select()->from($this->getEntityTable(), array($this->getEntityIdField()))->where('email = :customer_email');
     if ($customer->getSharingConfig()->isWebsiteScope()) {
         if (!$customer->hasData('website_id')) {
             Mage::throwException(Mage::helper('Mage_Customer_Helper_Data')->__('Customer website ID must be specified when using the website scope'));
         }
         $bind['website_id'] = (int) $customer->getWebsiteId();
         $select->where('website_id = :website_id');
     }
     $customerId = $adapter->fetchOne($select, $bind);
     if ($customerId) {
         $this->load($customer, $customerId);
     } else {
         $customer->setData(array());
     }
     return $this;
 }
开发者ID:relue,项目名称:magento2,代码行数:30,代码来源:Customer.php

示例4: loadByEmail

 /**
  * Load customer by email
  *
  * @param Mage_Customer_Model_Customer $customer
  * @param string $email
  * @param bool $testOnly
  * @return Mage_Customer_Model_Entity_Customer
  * @throws Mage_Core_Exception
  */
 public function loadByEmail(Mage_Customer_Model_Customer $customer, $email, $testOnly = false)
 {
     $select = $this->_getReadAdapter()->select()->from($this->getEntityTable(), array($this->getEntityIdField()))->where('email=:customer_email');
     if ($customer->getSharingConfig()->isWebsiteScope()) {
         if (!$customer->hasData('website_id')) {
             Mage::throwException(Mage::helper('customer')->__('Customer website id must be specified, when using website scope.'));
         }
         $select->where('website_id=?', (int) $customer->getWebsiteId());
     }
     if ($id = $this->_getReadAdapter()->fetchOne($select, array('customer_email' => $email))) {
         $this->load($customer, $id);
     } else {
         $customer->setData(array());
     }
     return $this;
 }
开发者ID:Rinso,项目名称:magento-mirror,代码行数:25,代码来源:Customer.php


注:本文中的Mage_Customer_Model_Customer::getSharingConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。