Remove Class::Data::Inheritable and use CAG 'inherited' style accessors
[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 use base 'DBIx::Class';
12
13 *pager = \&page;
14
15 sub page {
16   my $class = shift;
17
18   my $rs = $class->search(@_);
19   unless ($rs->{attrs}{page}) {
20     $rs = $rs->page(1);
21   }
22   return ( $rs->pager, $rs );
23 }
24
25 1;