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


PHP QuickBooks_Utilities::createMapping方法代码示例

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


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

示例1: _quickbooks_ca_customer_getbyname_callback

/**
 * This callback gets called when we fetch a customer by name 
 * 
 * This callback is attached to the API method $API->getCustomerByName(...) in 
 * the docs/example_api_client_canadian.php script. 
 * 
 * @param string $method	
 * @param string $action	The action type of method being executed (CustomerQuery)
 * @param mixed $ID			The primary key of the customer you tried to fetch
 * @param string $err		If an error occurs, you should pass back the error message here
 * @param string $qbxml		The raw qbXML response from QuickBooks
 * @param QuickBooks_API_Iterator
 * @param resource $resource	
 * @return void
 */
function _quickbooks_ca_customer_getbyname_callback($method, $action, $ID, &$err, $qbxml, $Iterator, $resource)
{
    global $dsn;
    global $user;
    if (is_object($Iterator) and $Iterator->count() > 0) {
        // We found a record matching this name, let's build a mapping of the
        //	primary key in QuickBooks to the primary key in our own application
        //
        //	The primary key in QuickBooks for anything transaction related
        //	(invoices, sales receipts, payments, etc.) is "TxnID", while the
        //	primary key in QuickBooks for anything non-transaction related
        //	(customers, sales tax codes, items, vendors, etc.) is "ListID"
        // Fetch the first item from the Iterator
        $Customer = $Iterator->next();
        // Build your own mapping...
        // mysql_query("INSERT INTO my_mapping_table ( qbType, qbListID_or_TxnID, application_primary_key ) VALUES ( 'Customer', '" . mysql_real_escape_string($Customer->getListID()) . "', " . (int) $ID . " ) ");
        // ... or use the built-in mapping methods
        QuickBooks_Utilities::createMapping($dsn, $user, QUICKBOOKS_OBJECT_CUSTOMER, $Customer->getListID(), $ID, $Customer->getEditSequence());
    } else {
        // No customer with that name was found
    }
}
开发者ID:rme,项目名称:pm2qb,代码行数:37,代码来源:example_api_server.php

示例2:

<?php

require_once '/home/library_php/QuickBooks.php';
$dsn = 'mysql://root:Odnotnev9@localhost/quickbooks';
$user = 'mapping_test';
QuickBooks_Utilities::createMapping($dsn, $user, QUICKBOOKS_OBJECT_CUSTOMER, '1234-1234', 15);
print "\n";
print "\n";
print 'App ID: ' . QuickBooks_Utilities::fetchApplicationID($dsn, $user, QUICKBOOKS_OBJECT_CUSTOMER, '1234-1234');
print "\n";
print "\n";
print 'QB ID: ' . QuickBooks_Utilities::fetchQuickbooksID($dsn, $user, QUICKBOOKS_OBJECT_CUSTOMER, 15);
print "\n";
print "\n";
开发者ID:dsesar,项目名称:quickbooks-php-devkit,代码行数:14,代码来源:mapping.php


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