Class::DBI::Plugin::Pager

Paged queries for CDBI
Download

Class::DBI::Plugin::Pager Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Nikolay S.
  • Publisher web site:
  • http://search.cpan.org/~majestic/

Class::DBI::Plugin::Pager Tags


Class::DBI::Plugin::Pager Description

Class::DBI::Plugin::Pager is a Perl module that adds a pager method to your class that can query using SQL::Abstract where clauses, and limit the number of rows returned to a specific subset.SYNOPSIS package CD; use base 'Class::DBI'; use Class::DBI::Plugin::AbstractCount; # pager needs this use Class::DBI::Plugin::Pager; # or to use a different syntax # use Class::DBI::Plugin::Pager::RowsTo; __PACKAGE__->set_db(...); # in a nearby piece of code... use CD; # see SQL::Abstract for how to specify the query my $where = { ... }; my $order_by => ; # bit by bit: my $pager = CD->pager; $pager->per_page( 10 ); $pager->page( 3 ); $pager->where( $where ); $pager->order_by( $order_by ); $pager->set_syntax( 'RowsTo' ); my @cds = $pager->search_where; # or all at once my $pager = CD->pager( $where, $order_by, 10, 3 ); my @cds = $pager->search_where; # or my $pager = CD->pager; my @cds = $pager->search_where( $where, $order_by, 10, 3 ); # $pager isa Data::Page # @cds contains the CDs just for the current pageProduct's homepage


Class::DBI::Plugin::Pager Related Software