File: Pager.pm

package info (click to toggle)
libdbix-class-perl 0.08196-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,424 kB
  • sloc: perl: 22,328; sql: 362; makefile: 10
file content (21 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package # hide from pause
  DBIx::Class::ResultSet::Pager;

use warnings;
use strict;

use base 'Data::Page';
use mro 'c3';

# simple support for lazy totals
sub _total_entries_accessor {
  if (@_ == 1 and ref $_[0]->{total_entries} eq 'CODE') {
    return $_[0]->{total_entries} = $_[0]->{total_entries}->();
  }

  return shift->next::method(@_);
}

sub _skip_namespace_frames { qr/^Data::Page/ }

1;