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


PHP Audit::getInstance方法代码示例

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


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

示例1: addTransaction

 public static function addTransaction($invoiceId, $customer, $amount, $currency_code, $description = '')
 {
     if (is_numeric($customer)) {
         /// customer ID is passed. Need to get customer object
         $customer = CustomerDAO::getInstance()->getCustomer($customer);
     }
     /// Now need to convert transaction amount to customer base currency
     $currency = Transaction::$instance->getRegistry()->get('currency');
     $amountInCustomerCurrency = (double) $currency->convert($amount, $currency_code, $customer['base_currency_code']);
     $newCustomerBalance = $customer['balance'] - $amountInCustomerCurrency;
     Transaction::$instance->getDb()->query("\r\n            INSERT INTO customer_transaction\r\n            SET\r\n                customer_id = " . (int) $customer['customer_id'] . ",\r\n                invoice_id = " . (int) $invoiceId . ",\r\n                description = '" . Transaction::$instance->getDb()->escape($description) . "',\r\n                amount = {$amountInCustomerCurrency},\r\n                currency_code = '" . $customer['base_currency_code'] . "',\r\n                date_added = NOW(),\r\n                balance = {$newCustomerBalance},\r\n                balance_currency = '" . Transaction::$instance->getDb()->escape($customer['base_currency_code']) . "'\r\n        ");
     //$transactionId = Transaction::$instance->getDb()->getLastId();
     /// Update customer's balance
     Transaction::$instance->getDb()->query("\r\n                UPDATE customer\r\n                SET\r\n                    balance = {$newCustomerBalance}\r\n                WHERE customer_id = " . $customer['customer_id']);
     Transaction::$instance->getCache()->delete('customer.' . $customer['customer_id']);
     if (Transaction::$instance->user->isLogged()) {
         Audit::getInstance(Transaction::$instance->getRegistry())->addAdminEntry(Transaction::$instance->user->getId(), AUDIT_ADMIN_TRANSACTION_ADD, $_REQUEST);
     } elseif (Transaction::$instance->customer->isLogged()) {
         Audit::getInstance(Transaction::$instance->getRegistry())->addUserEntry(Transaction::$instance->customer->getId(), AUDIT_ADMIN_TRANSACTION_ADD, $_REQUEST);
     }
 }
开发者ID:ralfeus,项目名称:moomi-daeri.com,代码行数:21,代码来源:Transaction.php

示例2: disable

 public function disable()
 {
     $this->changeStatusProducts(0);
     Audit::getInstance($this->getRegistry())->addAdminEntry($this->getUser()->getId(), AUDIT_ADMIN_PRODUCT_DISABLE, $_REQUEST);
 }
开发者ID:ralfeus,项目名称:moomi-daeri.com,代码行数:5,代码来源:product.php


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