CatalystX::CRUD::Iterator - generic iterator wrapper for CXCM iterator() results
package MyApp::Model::MyModel; use CatalystX::CRUD::Iterator; use MyModel; __PACKAGE__->config->{object_class} = 'MyModel::Object'; sub iterator { my ($self, $query) = @_; my $iterator = MyModel->search_for_something; # $iterator must have a next() method return CatalystX::CRUD::Iterator->new( $iterator, $self->object_class ); }
CatalystX::CRUD::Iterator is a general iterator class that wraps a real iterator and blesses return results into a specified class. CatalystX::CRUD::Iterator is a glue that provides for a similar level of abstraction across all kinds of CXCM classes.
Returns a CatalystX::CRUD::Iterator instance.
iterator must have a next() method and (optionally) a finish() method.
See next().
Calls the next() method on the internal iterator object, stashing the result in an object returned by class_name->new under the method_name accessor.
If the internal iterator object has a finish() method, this will call and return it. Otherwise returns true (1).
Returns array ref of all objects, having called serialize() on each one. Short-hand for:
my $objects = []; while ( my $o = $iterator->next ) { push @$objects, $o->serialize(); }
Peter Karman, <perl at peknet.com>
<perl at peknet.com>
Please report any bugs or feature requests to bug-catalystx-crud at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CatalystX-CRUD. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-catalystx-crud at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc CatalystX::CRUD
You can also look for information at:
Mailing List
https://groups.google.com/forum/#!forum/catalystxcrud
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/CatalystX-CRUD
CPAN Ratings
http://cpanratings.perl.org/d/CatalystX-CRUD
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=CatalystX-CRUD
Search CPAN
http://search.cpan.org/dist/CatalystX-CRUD
Copyright 2007 Peter Karman, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install CatalystX::CRUD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::CRUD
CPAN shell
perl -MCPAN -e shell install CatalystX::CRUD
For more information on module installation, please visit the detailed CPAN module installation guide.