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


PHP Mage_Customer_Model_Customer::getResource方法代码示例

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


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

示例1: _moveAttributesData

 /**
  * @param Mage_Customer_Model_Customer $customer
  */
 protected function _moveAttributesData($customer)
 {
     $attributes = array('po_limit' => $this->_poLimitId, 'po_credit' => $this->_poCreditId);
     foreach ($attributes as $attributeCode => $attributeId) {
         try {
             $select = $this->_db->select()->from($customer->getResource()->getTable('customer_entity_int'), array('value'))->where('attribute_id = ?', $attributeId)->where('entity_id = ?', $customer->getId());
             $value = $this->_db->fetchOne($select);
             if ((int) $value > 0) {
                 $this->_db->insert($customer->getResource()->getTable('customer_entity_decimal'), array('entity_type_id' => $customer->getEntityTypeId(), 'attribute_id' => $attributeId, 'entity_id' => $customer->getId(), 'value' => (int) $value));
             }
         } catch (Exception $e) {
         }
         try {
             $this->_db->delete($customer->getResource()->getTable('customer_entity_int'), 'entity_type_id = ' . $customer->getEntityTypeId() . ' AND attribute_id = ' . $attributeId . ' AND ' . 'entity_id = ' . $customer->getId());
         } catch (Exception $e) {
         }
     }
 }
开发者ID:flintdigital,项目名称:mage-mod-ar-po-emja,代码行数:21,代码来源:po_upgrade_3.0.3.php

示例2: _getAttributeValue

 private function _getAttributeValue(Mage_Customer_Model_Customer $customer, $attributeCode)
 {
     $attribute = $customer->getResource()->getAttribute($attributeCode);
     if (!$attribute) {
         return;
     }
     if (is_array($attribute)) {
         return join(",", $attribute->getFrontEnd()->getValue($customer));
     } else {
         if (!is_array($attribute)) {
             return $attribute->getFrontEnd()->getValue($customer);
         }
     }
 }
开发者ID:RxOuchy,项目名称:LDS_Client_Solutions,代码行数:14,代码来源:Data.php

示例3: __construct

 /**
  * Constructor
  *
  * @param array $data
  */
 public function __construct(array $data = array())
 {
     if (isset($data['attribute_collection'])) {
         $this->_attributeCollection = $data['attribute_collection'];
         unset($data['attribute_collection']);
     } else {
         $this->_attributeCollection = Mage::getResourceModel(static::ATTRIBUTE_COLLECTION_NAME);
         $this->_attributeCollection->addSystemHiddenFilterWithPasswordHash();
         $data['attribute_collection'] = $this->_attributeCollection;
     }
     parent::__construct($data);
     $this->_specialAttributes[] = self::COLUMN_WEBSITE;
     $this->_specialAttributes[] = self::COLUMN_STORE;
     $this->_permanentAttributes[] = self::COLUMN_EMAIL;
     $this->_permanentAttributes[] = self::COLUMN_WEBSITE;
     $this->_indexValueAttributes[] = 'group_id';
     $this->addMessageTemplate(self::ERROR_DUPLICATE_EMAIL_SITE, $this->_helper('Mage_ImportExport_Helper_Data')->__('E-mail is duplicated in import file'));
     $this->addMessageTemplate(self::ERROR_ROW_IS_ORPHAN, $this->_helper('Mage_ImportExport_Helper_Data')->__('Orphan rows that will be skipped due default row errors'));
     $this->addMessageTemplate(self::ERROR_INVALID_STORE, $this->_helper('Mage_ImportExport_Helper_Data')->__('Invalid value in Store column (store does not exists?)'));
     $this->addMessageTemplate(self::ERROR_EMAIL_SITE_NOT_FOUND, $this->_helper('Mage_ImportExport_Helper_Data')->__('E-mail and website combination is not found'));
     $this->addMessageTemplate(self::ERROR_PASSWORD_LENGTH, $this->_helper('Mage_ImportExport_Helper_Data')->__('Invalid password length'));
     $this->_initStores(true)->_initAttributes();
     $this->_customerModel = Mage::getModel('Mage_Customer_Model_Customer');
     /** @var $customerResource Mage_Customer_Model_Resource_Customer */
     $customerResource = $this->_customerModel->getResource();
     $this->_entityTable = $customerResource->getEntityTable();
 }
开发者ID:,项目名称:,代码行数:32,代码来源:


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