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


PHP Mage_Customer_Model_Customer::getEntityId方法代码示例

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


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

示例1: updateNames

 /**
  * updating names for subscriber after customer names update
  * @param Mage_Customer_Model_Customer $customer 
  */
 protected function updateNames($customer)
 {
     $subscriber = Mage::getModel('advancednewsletter/subscriber')->load($customer->getEntityId(), 'customer_id');
     if (!$subscriber->getId()) {
         return;
     }
     if ($subscriber->getData('last_name') != $customer->getLastname() || $subscriber->getData('first_name') != $customer->getFirstname()) {
         $subscriber->forceWrite(array('first_name' => $customer->getFirstname(), 'last_name' => $customer->getLastname()));
     }
     if ($subscriber->getEmail() != $customer->getEmail()) {
         $duplicate = Mage::getModel('advancednewsletter/subscriber')->load($customer->getEmail(), 'email');
         if (!$duplicate->getId()) {
             $subscriber->forceWrite(array('email' => $customer->getEmail()));
         }
     }
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:20,代码来源:Observer.php

示例2: _getWrapped

 /**
  * Wraps post, customer, store data into Varien_Object
  *
  * @param array $postData
  * @param Mage_Customer_Model_Customer $customer
  * @param Mage_Core_Model_Store $store
  *
  * @return Varien_Object
  */
 private function _getWrapped($postData, $customer, $store)
 {
     $objToReturn = new Varien_Object();
     $storeId = $store->getStoreId();
     $message = isset($postData['message']) ? htmlspecialchars($postData['message']) : '';
     $emailAddresses = $postData['email'];
     foreach ($emailAddresses as $key => $emailAddress) {
         if (empty($emailAddress) || !Zend_Validate::is($emailAddress, 'EmailAddress')) {
             unset($emailAddresses[$key]);
         }
     }
     $objToReturn->setData(array('emails' => $emailAddresses, 'customer_id' => $customer->getEntityId(), 'message' => $message, 'store_id' => $storeId));
     return $objToReturn;
 }
开发者ID:monarcmoso,项目名称:beta2,代码行数:23,代码来源:InvitationController.php

示例3: login

 /**
  * Send login data through API
  *
  * @param Mage_Customer_Model_Customer $customer
  * @throws Sailthru_Email_Model_Client_Exception
  * @return boolean
  */
 public function login(Mage_Customer_Model_Customer $customer)
 {
     try {
         $this->_eventType = 'login';
         $data = array('id' => $customer->getEmail(), 'key' => 'email', 'fields' => array('keys' => 1, 'engagement' => 1, 'activity' => 1, 'email' => $customer->getEmail(), 'extid' => $customer->getEntityId()), 'login' => array('site' => Mage::helper('core/url')->getHomeUrl(), 'ip' => Mage::helper('core/http')->getRemoteAddr(true), 'user_agent' => Mage::helper('core/http')->getHttpUserAgent(true)));
         if ($response = $this->apiPost('user', $data)) {
             return $this->setCookie($response);
         } else {
             throw new Sailthru_Email_Model_Client_Exception("Response: {$response} is not a valid JSON");
         }
     } catch (Sailthru_Email_Model_Client_Exception $e) {
         Mage::logException($e);
     } catch (Exception $e) {
         Mage::logException($e);
     }
 }
开发者ID:xiaoguizhidao,项目名称:sailthru-magento-extension,代码行数:23,代码来源:User.php


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