DBIx::EAV::Cursor - Represents a query used for fetching entities.
# get cursor from resultset my $cursor = $eav->resultset('CD')->search(\%query)->cursor; while (my $cd = $cursor->next) { # $cd is the raw hashref returned from database printf "CD id: %d\n", $cd->{id}; }
A cursor is used to build, execute and iterate over a SQL query for the entities table. A a cursor instance is returned from find and from get (when you get() related data). You will never need to create a instance of this class yourself.
Returns all entities in the result.
Returns the next element in the resultset (undef if there is none).
undef
Can be used to efficiently iterate over records in the resultset:
my $cursor = $eav->resultset('CD')->find; while (my $cd = $cursor->next) { print $cd->get('title'); }
Note that you need to store the cursor object, and call next on it. Calling resultset('CD')->next repeatedly will always return the first record from the cursor.
next
resultset('CD')->next
Resets the cursor (causing a fresh query to storage) and returns an object for the first result (or undef if the resultset is empty).
Deletes the current statement handle, if any. Next data fetching will trigger a new database query.
Copyright (C) Carlos Fernando Avila Gratz.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Carlos Fernando Avila Gratz <cafe@kreato.com.br>
To install DBIx::EAV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::EAV
CPAN shell
perl -MCPAN -e shell install DBIx::EAV
For more information on module installation, please visit the detailed CPAN module installation guide.