本文整理汇总了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;
}
示例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;
}
示例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();
}