我正在使用镜像脚本将数据从QuickBooks复制到MySQL数据库。问题是,如果从Quickbooks中删除了一项, 在MySQL数据库中,未将qbsql_flag_deleted设置为1表示删除了该记录。此外,回调挂钩中不会收到已删除的记录。
consolibyte_sqlmirror_integration文档中提到了以下文本,但我已经确认删除项目不会将qbsql_flag_deleted列值更新为1。
“ qbsql_flag_deleted :在QuickBooks中删除记录时,此字段将设置为1。您的应用程序不应显示带有qbsql_flag_deleted字段值的记录之1。”
在mysql_mirror脚本中,我已设置了delete_flag的启用功能,但无法正常工作。 请从我正在使用的镜像脚本中找到以下代码片段:
$mode = QuickBooks_WebConnector_Server_SQL::MODE_READWRITE;
$conflicts = QuickBooks_WebConnector_Server_SQL::CONFLICT_LOG;
$delete = QuickBooks_WebConnector_Server_SQL::DELETE_FLAG;
$hook_obj = Hook::getInstance();
$hooks = array(
QuickBooks_SQL::HOOK_SQL_INSERT => array(
//'preHookHandler',
array( $hook_obj, 'insertHook' ),
),
QuickBooks_SQL::HOOK_SQL_UPDATE => array(
array( $hook_obj, 'updateHook' ),
),
);
$soap_options = array();
$handler_options = array(
'deny_concurrent_logins' => false,
'deny_reallyfast_logins' => false,
);
$driver_options = array();
$ops = array(
QUICKBOOKS_OBJECT_ACCOUNT,
QUICKBOOKS_OBJECT_SALESTAXITEM,
QUICKBOOKS_OBJECT_SALESTAXCODE,
QUICKBOOKS_OBJECT_CUSTOMER,
QUICKBOOKS_OBJECT_VENDOR,
QUICKBOOKS_OBJECT_TEMPLATE,
QUICKBOOKS_OBJECT_CUSTOMERTYPE,
QUICKBOOKS_OBJECT_VENDORTYPE,
QUICKBOOKS_OBJECT_ESTIMATE,
QUICKBOOKS_OBJECT_INVOICE,
QUICKBOOKS_OBJECT_CLASS,
QUICKBOOKS_OBJECT_UNITOFMEASURESET,
QUICKBOOKS_OBJECT_STANDARDTERMS,
QUICKBOOKS_OBJECT_INVENTORYITEM,
QUICKBOOKS_OBJECT_NONINVENTORYITEM,
QUICKBOOKS_OBJECT_SERVICEITEM,
QUICKBOOKS_OBJECT_SHIPMETHOD,
QUICKBOOKS_OBJECT_PAYMENTMETHOD,
QUICKBOOKS_OBJECT_TERMS,
QUICKBOOKS_OBJECT_PRICELEVEL,
QUICKBOOKS_OBJECT_ITEM,
QUICKBOOKS_OBJECT_INVENTORYASSEMBLYITEM,
//QUICKBOOKS_OBJECT_GROUPITEM,
QUICKBOOKS_OBJECT_SALESTAXGROUPITEM,
QUICKBOOKS_OBJECT_SUBTOTALITEM,
QUICKBOOKS_OBJECT_OTHERCHARGEITEM,
QUICKBOOKS_OBJECT_RECEIVEPAYMENT,
QUICKBOOKS_OBJECT_PAYMENTMETHOD,
QUICKBOOKS_OBJECT_COMPANY,
QUICKBOOKS_OBJECT_HOST,
QUICKBOOKS_OBJECT_PREFERENCES,
QUICKBOOKS_QUERY_DELETEDTRANSACTIONS,
QUICKBOOKS_OBJECT_SALESREP,
QUICKBOOKS_OBJECT_DATAEXT,
QUICKBOOKS_OBJECT_DATAEXTDEF
);
$ops_misc = array(
QUICKBOOKS_DERIVE_INVENTORYLEVELS,
QUICKBOOKS_QUERY_DELETEDLISTS,
QUICKBOOKS_QUERY_DELETEDTRANSACTIONS
);
$sql_options = array(
'only_import' => $ops,
'only_add' => $ops,
'only_modify' => $ops,
'only_misc' => $ops_misc,
);
$callback_options = array();
$Server = new QuickBooks_WebConnector_Server_SQL(
$dsn,
'1 minute',
$mode,
$conflicts,
$delete,
$username,
array(),
array(),
$hooks,
QUICKBOOKS_LOG_DEVELOP,
QUICKBOOKS_SOAPSERVER_BUILTIN,
QUICKBOOKS_WSDL,
$soap_options,
$handler_options,
$driver_options,
$sql_options,
$callback_options);
$Server->handle(true, true);