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


PHP Mage_Sales_Model_Resource_Order_Abstract类代码示例

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


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

示例1: _initVirtualGridColumns

 /**
  * Init virtual grid records for entity
  *
  * @return Mage_Sales_Model_Resource_Order_Invoice
  */
 protected function _initVirtualGridColumns()
 {
     parent::_initVirtualGridColumns();
     $adapter = $this->_getReadAdapter();
     $checkedFirstname = $adapter->getIfNullSql('{{table}}.firstname', $adapter->quote(''));
     $checkedLastname = $adapter->getIfNullSql('{{table}}.lastname', $adapter->quote(''));
     $this->addVirtualGridColumn('billing_name', 'sales_flat_order_address', array('billing_address_id' => 'entity_id'), $adapter->getConcatSql(array($checkedFirstname, $adapter->quote(' '), $checkedLastname)))->addVirtualGridColumn('order_increment_id', 'sales_flat_order', array('order_id' => 'entity_id'), 'increment_id')->addVirtualGridColumn('order_created_at', 'sales_flat_order', array('order_id' => 'entity_id'), 'created_at');
     return $this;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:14,代码来源:Invoice.php

示例2: _initVirtualGridColumns

 /**
  * Init virtual grid records for entity
  *
  * @return Mage_Sales_Model_Resource_Order
  */
 protected function _initVirtualGridColumns()
 {
     parent::_initVirtualGridColumns();
     $adapter = $this->getReadConnection();
     $ifnullFirst = $adapter->getIfNullSql('{{table}}.firstname', $adapter->quote(''));
     $ifnullLast = $adapter->getIfNullSql('{{table}}.lastname', $adapter->quote(''));
     $concatAddress = $adapter->getConcatSql(array($ifnullFirst, $adapter->quote(' '), $ifnullLast));
     $this->addVirtualGridColumn('billing_name', 'sales_flat_order_address', array('billing_address_id' => 'entity_id'), $concatAddress)->addVirtualGridColumn('shipping_name', 'sales_flat_order_address', array('shipping_address_id' => 'entity_id'), $concatAddress);
     return $this;
 }
开发者ID:relue,项目名称:magento2,代码行数:15,代码来源:Order.php

示例3: _afterSave

 /**
  * Update related grid table after object save
  *
  * @param Varien_Object $object
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $resource = parent::_afterSave($object);
     if ($object->hasDataChanges() && $object->getOrder()) {
         $gridList = array('sales/order' => 'entity_id', 'sales/order_invoice' => 'order_id', 'sales/order_shipment' => 'order_id', 'sales/order_creditmemo' => 'order_id');
         // update grid table after grid update
         foreach ($gridList as $gridResource => $field) {
             Mage::getResourceModel($gridResource)->updateOnRelatedRecordChanged($field, $object->getParentId());
         }
     }
     return $resource;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:18,代码来源:Address.php

示例4: _beforeSave

 /**
  * Lookup for parent_id in already saved transactions of this payment by the order_id
  * Also serialize additional information, if any
  *
  * @throws Mage_Core_Exception
  *
  * @param Mage_Sales_Model_Order_Payment_Transaction $transaction
  * @return Mage_Sales_Model_Resource_Order_Payment_Transaction
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $transaction)
 {
     $parentTxnId = $transaction->getData('parent_txn_id');
     $txnId = $transaction->getData('txn_id');
     $orderId = $transaction->getData('order_id');
     $paymentId = $transaction->getData('payment_id');
     $idFieldName = $this->getIdFieldName();
     if ($parentTxnId) {
         if (!$txnId || !$orderId || !$paymentId) {
             Mage::throwException(Mage::helper('sales')->__('Not enough valid data to save the parent transaction ID.'));
         }
         $parentId = (int) $this->_lookupByTxnId($orderId, $paymentId, $parentTxnId, $idFieldName);
         if ($parentId) {
             $transaction->setData('parent_id', $parentId);
         }
     }
     // make sure unique key won't cause trouble
     if ($transaction->isFailsafe()) {
         $autoincrementId = (int) $this->_lookupByTxnId($orderId, $paymentId, $txnId, $idFieldName);
         if ($autoincrementId) {
             $transaction->setData($idFieldName, $autoincrementId)->isObjectNew(false);
         }
     }
     return parent::_beforeSave($transaction);
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:34,代码来源:Transaction.php


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