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


PHP Mage_Core_Model_Abstract::getCustomerId方法代码示例

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


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

示例1: _getAlertRow

 protected function _getAlertRow(Mage_Core_Model_Abstract $object)
 {
     if ($object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
         $sql = $this->_getWriteAdapter()->select()->from($this->getMainTable())->where('customer_id=?', $object->getCustomerId())->where('product_id=?', $object->getProductId())->where('website_id=?', $object->getWebsiteId());
         return $this->_getWriteAdapter()->fetchRow($sql);
     }
     return false;
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:8,代码来源:Stock.php

示例2: _getAlertRow

 /**
  * Retrieve alert row by object parameters
  *
  * @param Mage_Core_Model_Abstract $object
  * @return array|bool
  */
 protected function _getAlertRow(Mage_Core_Model_Abstract $object)
 {
     $adapter = $this->_getReadAdapter();
     if ($object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
         $select = $adapter->select()->from($this->getMainTable())->where('customer_id = :customer_id')->where('product_id  = :product_id')->where('website_id  = :website_id');
         $bind = array(':customer_id' => $object->getCustomerId(), ':product_id' => $object->getProductId(), ':website_id' => $object->getWebsiteId());
         return $adapter->fetchRow($select, $bind);
     }
     return false;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:16,代码来源:Abstract.php

示例3: _afterLoad

 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getCustomerId()) {
         $cust = Mage::getModel("customer/customer")->load($object->getCustomerId());
         if ($cust) {
             Mage::helper('remarketing')->setGroupNameAndGenderNameForCustomer($cust);
             $object->setCustomer($cust);
         }
     }
     if ($object->getId()) {
         $this->loadEmails($object);
         $this->loadClicks($object);
     }
     return parent::_afterLoad($object);
 }
开发者ID:RxOuchy,项目名称:LDS_Client_Solutions,代码行数:15,代码来源:Session.php

示例4: _afterLoad

 /**
  * Inflate session object
  *
  * @param Listrak_Remarketing_Model_Session $object Session
  *
  * @return Listrak_Remarketing_Model_Session
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getCustomerId()) {
         /* @var Mage_Customer_Model_Customer $customer */
         $customer = Mage::getModel("customer/customer")->load($object->getCustomerId());
         if ($customer) {
             /* @var Listrak_Remarketing_Helper_Data $helper */
             $helper = Mage::helper('remarketing');
             $helper->setGroupNameAndGenderNameForCustomer($customer);
             $object->setCustomer($customer);
         }
     }
     if ($object->getId()) {
         $this->loadEmails($object);
         $this->loadClicks($object);
     }
     return parent::_afterLoad($object);
 }
开发者ID:RxOuchy,项目名称:LDS_Client_Solutions,代码行数:25,代码来源:Session.php

示例5: loadByProduct

 public function loadByProduct(Mage_Core_Model_Abstract $object, $product)
 {
     $read = $this->_getReadAdapter();
     if ($product instanceof Mage_Catalog_Model_Product) {
         $productId = $product->getId();
     } else {
         $productId = (int) $product;
     }
     $select = $read->select()->from($this->getMainTable())->where('product_id=?', $productId)->where('visitor_id=?', $object->getVisitorId());
     if ($object->getCustomerId()) {
         $select->where('customer_id=?', $object->getCustomerId());
     }
     $data = $read->fetchRow($select);
     if (!$data) {
         return false;
     }
     $object->setData($data);
     $this->_afterLoad($object);
     return true;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:20,代码来源:Item.php

示例6: _afterLoad

	public function _afterLoad(Mage_Core_Model_Abstract $object){
		$webform = Mage::getModel('webforms/webforms')->load($object->getData('webform_id'));
		$fields_to_fieldsets = $webform->getFieldsToFieldsets();

		$select = $this->_getReadAdapter()->select()
			->from($this->getTable('webforms/results_values'))
			->where('result_id = ?', $object->getId());	
		$values = $this->_getReadAdapter()->fetchAll($select);
		
		foreach($values as $val){
			$object->setData('field_'.$val['field_id'],$val['value']);
		}
		
		$object->setData('ip',long2ip($object->getCustomerIp()));
		if($object->getCustomerId()){
			$object->setData('customer',Mage::getModel('customer/customer')->load($object->getCustomerId())->getName());
		} else {
			$object->setData('customer',Mage::helper('webforms')->__('Guest'));
		}
		return parent::_afterLoad($object);
	}
开发者ID:riteshsahu1981,项目名称:captainkyso,代码行数:21,代码来源:Results.php

示例7: _beforeSave

 /**
  * Before save action
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (is_null($object->getId()) && $object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
         if ($row = $this->_getAlertRow($object)) {
             $object->addData($row);
             $object->setStatus(0);
         }
     }
     if (is_null($object->getAddDate())) {
         $object->setAddDate(Mage::getModel('core/date')->gmtDate());
         $object->setStatus(0);
     }
     return parent::_beforeSave($object);
 }
开发者ID:okite11,项目名称:frames21,代码行数:20,代码来源:Stock.php

示例8: _afterSave

 /**
  * Perform actions after object save
  *
  * @param Varien_Object $object
  * @return Mage_Review_Model_Resource_Review
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $adapter = $this->_getWriteAdapter();
     /**
      * save detail
      */
     $detail = array('title' => $object->getTitle(), 'detail' => $object->getDetail(), 'nickname' => $object->getNickname());
     $select = $adapter->select()->from($this->_reviewDetailTable, 'detail_id')->where('review_id = :review_id');
     $detailId = $adapter->fetchOne($select, array(':review_id' => $object->getId()));
     if ($detailId) {
         $condition = array("detail_id = ?" => $detailId);
         $adapter->update($this->_reviewDetailTable, $detail, $condition);
     } else {
         $detail['store_id'] = $object->getStoreId();
         $detail['customer_id'] = $object->getCustomerId();
         $detail['review_id'] = $object->getId();
         $adapter->insert($this->_reviewDetailTable, $detail);
     }
     /**
      * save stores
      */
     $stores = $object->getStores();
     if (!empty($stores)) {
         $condition = array('review_id = ?' => $object->getId());
         $adapter->delete($this->_reviewStoreTable, $condition);
         $insertedStoreIds = array();
         foreach ($stores as $storeId) {
             if (in_array($storeId, $insertedStoreIds)) {
                 continue;
             }
             $insertedStoreIds[] = $storeId;
             $storeInsert = array('store_id' => $storeId, 'review_id' => $object->getId());
             $adapter->insert($this->_reviewStoreTable, $storeInsert);
         }
     }
     // reaggregate ratings, that depend on this review
     $this->_aggregateRatings($this->_loadVotedRatingIds($object->getId()), $object->getEntityPkValue());
     return $this;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:45,代码来源:Review.php

示例9: getModelVars

 /**
  * Gets the variables which can be used as a placeholder in the filename.
  *
  * @param  Mage_Core_Model_Abstract $model the model instance
  *
  * @return array with the variables which can be use as placeholders in the filename
  */
 public function getModelVars($model)
 {
     if (!$model instanceof Mage_Sales_Model_Order) {
         switch ($model) {
             case $model instanceof Mage_Sales_Model_Order_Invoice:
                 $specificVars = array('{{invoice_id}}' => $model->getIncrementId());
                 break;
             case $model instanceof Mage_Sales_Model_Order_Shipment:
                 $specificVars = array('{{shipment_id}}' => $model->getIncrementId());
                 break;
             case $model instanceof Mage_Sales_Model_Order_Creditmemo:
                 $specificVars = array('{{creditmemo_id}}' => $model->getIncrementId());
         }
         $order = $model->getOrder();
         $commonVars = array('{{order_id}}' => $order->getIncrementId(), '{{customer_id}}' => $order->getCustomerId(), '{{customer_name}}' => $order->getCustomerName(), '{{customer_firstname}}' => $order->getCustomerFirstname(), '{{customer_lastname}}' => $order->getCustomerLastname());
         return array_merge($specificVars, $commonVars);
     } else {
         return array('{{order_id}}' => $model->getIncrementId(), '{{customer_id}}' => $model->getCustomerId(), '{{customer_name}}' => $model->getCustomerName(), '{{customer_firstname}}' => $model->getCustomerFirstname(), '{{customer_lastname}}' => $model->getCustomerLastname());
     }
 }
开发者ID:codedge,项目名称:firegento-pdf,代码行数:27,代码来源:Data.php


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