脚本宝典收集整理的这篇文章主要介绍了php – Quickbooks桌面多个实体自定义字段,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$map = array(QUICKBOOKS_MOD_DATAEXT => array( 'employee_custom_field_request','employee_custom_field_response','customer_custom_field_request','customer_custom_field_response' )
现在如果我只需要更新员工自定义字段,我会将请求排入队列
$Queue = new QuickBooks_WebConnector_Queue('MysqLi://username:password@localhost/quickbook'); $Queue->enqueue(QUICKBOOKS_MOD_DATAEXT,$id);
因此,每当我运行Web连接器时,客户和员工自定义字段都会请求&响应函数将被调用,那么我应该如何编写只调用特定实体函数(客户或员工)?或者在consolibyte库中有什么方法可以区分它的调用吗?
这些常量QUICKBOOKS_MOD_DATAEXT完全是任意的.例如你可以这样做:
$Queue->enqueue('CustomFielDForCustomer',$id); $Queue->enqueue('CustomFieldForEmployee',$another_id);
你可以在那里使用你想要的任何东西,只要你在 – > enqueue(…)的调用中匹配你的$map中的东西.所以只需要编写一些新的常量.
另一种选择是传递额外的额外数据.例如.:
$Queue->enqueue(QUICKBOOKS_MOD_DATAEXT,$your_id,null,array( 'this_is_for_a' => 'customer' );
function CUSTOMER_OR_EMPLOYEE_custom_field_request($requestID,$user,$action,$ID,$extra,&$err,$last_action_time,$last_actionident_time,$XMl,$idents) { if ($extra['this_is_for_a'] == 'customer') { // ... do something for customers } else { // ... do something for employees } }
以上是脚本宝典为你收集整理的php – Quickbooks桌面多个实体自定义字段全部内容,希望文章能够帮你解决php – Quickbooks桌面多个实体自定义字段所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。