|
NAMENet::FreshBooks::API::Iterator - FreshBooks Iterator objectsVERSIONversion 0.24SYNOPSISYou 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; } newmy $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. nextmy $next_result = $iterator->next( ); Returns the next item in the iterator. totalReturns the total number of results available, regardless of how many items are on the current page.pagesReturns the total number of result pagescurrent_indexThe item we are currently onAUTHORS
COPYRIGHT AND LICENSEThis 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.
Visit the GSP FreeBSD Man Page Interface. |