//	the HTTP server throws an error after receiving to much data.
//
//	Thus, instead of sending just a single request, we're going to fetch the
//	list of customers by date range instead.
$seconds_in_a_day = 60 * 60 * 24;
for ($i = strtotime('2009-04-07'); $i < time(); $i = $i + $seconds_in_a_day) {
    $search = array('FromModifiedDate' => QuickBooks_Utilities::datetime($i), 'ToModifiedDate' => QuickBooks_Utilities::datetime($i + $seconds_in_a_day));
    if ($API->searchCustomers($search, '_quickbooks_ca_customer_search_callback')) {
        print 'Fetch customers from: ' . $search['FromModifiedDate'] . ' to ' . $search['ToModifiedDate'] . "\n";
    }
}
// Get a complete list of "Invoices" from QuickBooks
$seconds_in_a_day = 60 * 60 * 24;
for ($i = strtotime('2009-04-07'); $i < time(); $i = $i + $seconds_in_a_day) {
    $search = array('ModifiedDateRangeFilter FromModifiedDate' => QuickBooks_Utilities::datetime($i), 'ModifiedDateRangeFilter ToModifiedDate' => QuickBooks_Utilities::datetime($i + $seconds_in_a_day));
    if ($API->searchInvoices($search, '_quickbooks_ca_invoice_search_callback')) {
        print 'Fetch invoices from: ' . $search['ModifiedDateRangeFilter FromModifiedDate'] . ' to ' . $search['ModifiedDateRangeFilter ToModifiedDate'] . "\n";
    }
}
// Fetch a specific customer from QuickBooks by Name
//
// We're going to query QuickBooks for a customer named "Keith Palmer".
//	The query will be executed against QuickBooks and the function named
//	"_quickbooks_ca_customer_getbyname_callback" will be called with an
//	Iterator object. The Iterator will either be empty (there is no customer by
//	the name of "Keith Palmer") or contain Keith's complete customer record.
//
// Pretend for a minute that we actually have "Keith Palmer" in our own web
//	application, and what we'd really like to do is check if he exists in
//	QuickBooks, and then create a mapping so we know that Keith's primate key
//	in our database maps to QuickBooks primary key XYZ. To accomplish this,