【问题标题】:QBSDK iterator support in consolibyteconolibyte 中的 QBSDK 迭代器支持
【发布时间】:2020-12-07 08:06:38
【问题描述】:

我需要获取大量数据,所以我想使用 QBSDK 的迭代器功能。我想知道 conolibyte 库是否对它有任何固有的支持。

【问题讨论】:

    标签: quickbooks


    【解决方案1】:

    lib 中包含的几个示例使用迭代器:

        function _quickbooks_invoice_import_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
        {
            // Iterator support (break the result set into small chunks)
            $attr_iteratorID = '';
            $attr_iterator = ' iterator="Start" ';
            if (empty($extra['iteratorID']))
            {
                // This is the first request in a new batch
                $last = _quickbooks_get_last_run($user, $action);
                _quickbooks_set_last_run($user, $action);           // Update the last run time to NOW()
                
                // Set the current run to $last
                _quickbooks_set_current_run($user, $action, $last);
            }
            else
            {
                // This is a continuation of a batch
                $attr_iteratorID = ' iteratorID="' . $extra['iteratorID'] . '" ';
                $attr_iterator = ' iterator="Continue" ';
                
                $last = _quickbooks_get_current_run($user, $action);
            }
            
            // Build the request
            $xml = '<?xml version="1.0" encoding="utf-8"?>
                <?qbxml version="' . $version . '"?>
                <QBXML>
                    <QBXMLMsgsRq onError="stopOnError">
                        <InvoiceQueryRq ' . $attr_iterator . ' ' . $attr_iteratorID . ' requestID="' . $requestID . '">
    ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-21
      • 2012-07-12
      • 2013-11-10
      • 2012-01-28
      • 1970-01-01
      • 2017-07-03
      • 2021-08-12
      • 1970-01-01
      相关资源
      最近更新 更多