Commit | Line | Data |
---|---|---|
75d07914 | 1 | package # hide from PAUSE |
2 | DBIx::Class::CDBICompat::Pager; | |
65c2b042 | 3 | |
75d07914 | 4 | use strict; |
5 | use warnings FATAL => 'all'; | |
65c2b042 | 6 | |
75d07914 | 7 | *pager = \&page; |
65c2b042 | 8 | |
75d07914 | 9 | sub page { |
10 | my $class = shift; | |
65c2b042 | 11 | |
75d07914 | 12 | my $rs = $class->search(@_); |
8fbed205 | 13 | unless ($rs->{attrs}{page}) { |
75d07914 | 14 | $rs = $rs->page(1); |
15 | } | |
16 | return ( $rs->pager, $rs ); | |
17 | } | |
65c2b042 | 18 | |
75d07914 | 19 | 1; |