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


PHP unknown_type::setState方法代码示例

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


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

示例1: array

 /**
  * Method to set the model state
  * can be override in the child class
  * @param unknown_type $model
  * @return array
  */
 function _setModelState($model)
 {
     $app = JFactory::getApplication();
     $ns = $app->getName() . '::' . 'com.tienda.model.' . $model->getTable()->get('_suffix');
     $state = array();
     $filters = $this->getFilters();
     foreach ($filters as $k => $val) {
         $state[$k] = $app->getUserStateFromRequest($ns . str_replace('filter_', '', $k), $k, '', '');
     }
     foreach (@$state as $key => $value) {
         $model->setState($key, $value);
     }
     return $state;
 }
开发者ID:annggeel,项目名称:tienda,代码行数:20,代码来源:products.php

示例2: array

 /**
  * Method to set the model state
  * can be override in the child class
  * @param unknown_type $model
  * @return array
  */
 function _setModelState($model)
 {
     $app = JFactory::getApplication();
     $ns = $app->getName() . '::' . 'com.tienda.model.' . $model->getTable()->get('_suffix');
     $state = array();
     $state['limit'] = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
     $state['limitstart'] = $app->getUserStateFromRequest($ns . 'limitstart', 'limitstart', 0, 'int');
     $state['order'] = $app->getUserStateFromRequest($ns . '.filter_order', 'filter_order', 'tbl.' . $model->getTable()->getKeyName(), 'cmd');
     $state['direction'] = $app->getUserStateFromRequest($ns . '.filter_direction', 'filter_direction', 'ASC', 'word');
     $state['filter'] = $app->getUserStateFromRequest($ns . '.filter', 'filter', '', 'string');
     $state['filter_enabled'] = $app->getUserStateFromRequest($ns . 'enabled', 'filter_enabled', '', '');
     $filters = $this->getFilters();
     foreach ($filters as $k => $val) {
         $state[$k] = $app->getUserStateFromRequest($ns . str_replace('filter_', '', $k), $k, '', '');
     }
     foreach (@$state as $key => $value) {
         $model->setState($key, $value);
     }
     return $state;
 }
开发者ID:annggeel,项目名称:tienda,代码行数:26,代码来源:_base.php

示例3: _updateInvoices

 /**
  * Set the invoice status to "Paid" after a successful payment
  *
  * @param unknown_type $order
  */
 private function _updateInvoices($order, $message)
 {
     $invoices = $order->getInvoiceCollection();
     $state = Mage_Sales_Model_Order::STATE_PROCESSING;
     $payment = $order->getPayment();
     $transaction;
     $session = Mage::getSingleton('checkout/session');
     $szNewCrossReference;
     $transactionId = $payment->getLastTransId();
     $transaction = $payment->getTransaction($transactionId);
     $transactionType = $transaction->getTxnType();
     if ($session->getNewCrossReference()) {
         $szNewCrossReference = $session->getNewCrossReference();
         $value = $transaction->setTxnId($szNewCrossReference);
         $transaction->save();
         $payment->setLastTransId($szNewCrossReference);
         $session->setNewCrossReference(null);
     }
     foreach ($invoices as $invoice) {
         // set the invoice state to be "Paid"
         $invoice->pay()->save();
     }
     // add a comment to the order comments
     if ($transactionType == 'authorization') {
         $order->setState($state, 'csv_preauth', $message, true);
     } else {
         if ($transactionType == 'capture') {
             $order->setState($state, 'csv_paid', $message, true);
         } else {
             Mage::throwException('invalid transaction type [' . $transactionType . '] for invoice updating');
         }
     }
     $order->save();
 }
开发者ID:sohagan,项目名称:magento-modules,代码行数:39,代码来源:PaymentController.php


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