Commit | Line | Data |
---|---|---|
75d07914 | 1 | package # hide from PAUSE |
2 | DBIx::Class::CDBICompat::Pager; | |
65c2b042 | 3 | |
75d07914 | 4 | use strict; |
9f7d5590 | 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 | |
75d07914 | 9 | use warnings FATAL => 'all'; |
65c2b042 | 10 | |
5e0eea35 | 11 | use base 'DBIx::Class'; |
12 | ||
51ec0382 | 13 | sub pager { shift->page(@_) } |
65c2b042 | 14 | |
75d07914 | 15 | sub page { |
16 | my $class = shift; | |
65c2b042 | 17 | |
75d07914 | 18 | my $rs = $class->search(@_); |
8fbed205 | 19 | unless ($rs->{attrs}{page}) { |
75d07914 | 20 | $rs = $rs->page(1); |
21 | } | |
22 | return ( $rs->pager, $rs ); | |
23 | } | |
65c2b042 | 24 | |
75d07914 | 25 | 1; |