GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::FreshBooks::API::Iterator(3) User Contributed Perl Documentation Net::FreshBooks::API::Iterator(3)

Net::FreshBooks::API::Iterator - FreshBooks Iterator objects

version 0.24

You should never need to create an Iterator yourself. Iterators are created via the list() method. However, you should be aware that iterators do not currently handle pagination for you. So, something like this will let you page through your results.

    my $page     = 1;
    my $per_page = 50;
    while ( 1 ) {
        my $invoices
            = $fb->invoice->list( { page => $page, per_page => $per_page } );
        while ( my $invoice = $invoices->next ) {
            print $invoice->invoice_id . "\n";
        }
        last if $page >= $invoices->pages;
        ++$page;
    }

    my $iterator = $class->new(
        {   parent_object => $parent_object,
            args         => {...},
        }
    );

Create a new iterator object. As part of creating the iterator a request is sent to FreshBooks.

    my $next_result = $iterator->next(  );

Returns the next item in the iterator.

Returns the total number of results available, regardless of how many items are on the current page.

Returns the total number of result pages

The item we are currently on

  • Edmund von der Burg <evdb@ecclestoad.co.uk>
  • Olaf Alders <olaf@wundercounter.com>

This software is copyright (c) 2011 by Edmund von der Burg & Olaf Alders.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2022-04-13 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.