203b59855fe8dc4bbdb79d0042fc0c3653b55352
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Pager.pm
1 package # hide from PAUSE
2     DBIx::Class::CDBICompat::Pager;
3
4 use strict;
5
6 # even though fatalization has been proven over and over to be a universally
7 # bad idea, this line has been part of the code from the beginning
8 # leaving the compat layer as-is, something may in fact depend on that
9 use warnings FATAL => 'all';
10
11 *pager = \&page;
12
13 sub page {
14   my $class = shift;
15
16   my $rs = $class->search(@_);
17   unless ($rs->{attrs}{page}) {
18     $rs = $rs->page(1);
19   }
20   return ( $rs->pager, $rs );
21 }
22
23 1;