Fix idiocy that snuck in bdbd2ae8a - I only want fatal undefs
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Pager.pm
CommitLineData
75d07914 1package # hide from PAUSE
2 DBIx::Class::CDBICompat::Pager;
65c2b042 3
75d07914 4use strict;
c9b4271f 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 9use warnings FATAL => 'all';
65c2b042 10
75d07914 11*pager = \&page;
65c2b042 12
75d07914 13sub page {
14 my $class = shift;
65c2b042 15
75d07914 16 my $rs = $class->search(@_);
8fbed205 17 unless ($rs->{attrs}{page}) {
75d07914 18 $rs = $rs->page(1);
19 }
20 return ( $rs->pager, $rs );
21}
65c2b042 22
75d07914 231;