本文整理汇总了PHP中CORE_database::ignore_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP CORE_database::ignore_fields方法的具体用法?PHP CORE_database::ignore_fields怎么用?PHP CORE_database::ignore_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CORE_database
的用法示例。
在下文中一共展示了CORE_database::ignore_fields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
function update($VAR)
{
global $C_translate, $C_debug;
/* load database object */
$db = new CORE_database();
$this->construct();
$type = "update";
/* conditional fields for cc/eft */
$dbx =& DB();
$rs = $dbx->Execute(sqlSelect($dbx, "account_billing", "card_type,id,checkout_plugin_id", "id=::{$VAR['id']}::"));
if (!$rs || !$rs->RecordCount()) {
return false;
}
$billing_id = $rs->fields['id'];
$checkout_plugin_id = $rs->fields['checkout_plugin_id'];
if ($rs->fields['card_type'] == 'eft') {
/* EFT */
$this->method["{$type}"] = $db->ignore_fields(array('card_exp_month', 'card_exp_year', 'card_num'), $this->method["{$type}"]);
/* last four */
@($VAR['account_billing_card_num4'] = substr($VAR['account_billing_eft_check_acct'], strlen($VAR['account_billing_eft_check_acct']) - 4, 4));
} else {
/* CC */
# Validate the exp date
if (mktime(0, 0, 0, $VAR['account_billing_card_exp_month'], date('d'), $VAR['account_billing_card_exp_year']) <= time()) {
$msg = $C_translate->translate('val_exp', 'account_billing', '');
$C_debug->alert($msg);
return false;
}
# Validate the card against the card type
include_once PATH_CORE . 'validate.inc.php';
$validate = new CORE_validate();
if (!$validate->validate_cc(@$VAR['account_billing_card_num'], 'card_num', @$VAR['account_billing_card_type'], false)) {
$msg = $C_translate->translate('val_cc', 'account_billing', '');
$C_debug->alert($msg);
return false;
}
$this->method["{$type}"] = $db->ignore_fields(array('eft_trn', 'eft_check_acct'), $this->method["{$type}"]);
/* last four */
@($VAR['account_billing_card_num4'] = substr($VAR['account_billing_card_num'], strlen($VAR['account_billing_card_num']) - 4, 4));
}
if ($db->update($VAR, $this, $type)) {
# Update any invoices using this billing record
$dba =& DB();
$sql = "UPDATE " . AGILE_DB_PREFIX . "invoice SET\n\t\t\t\t\t\tcheckout_plugin_id \t= " . $dba->qstr($checkout_plugin_id) . "\n\t\t\t\t\t\tWHERE site_id\t\t\t\t= " . $dba->qstr(DEFAULT_SITE) . "\n\t\t\t\t\t\tAND account_billing_id\t= " . $dba->qstr($billing_id);
$result = $dba->Execute($sql);
return true;
}
return false;
}