1package DBIx::Class::Helper::ResultSet::Shortcut::LimitedPage;
2$DBIx::Class::Helper::ResultSet::Shortcut::LimitedPage::VERSION = '2.036000';
3use strict;
4use warnings;
5
6use parent qw(
7  DBIx::Class::Helper::ResultSet::Shortcut::Rows
8  DBIx::Class::Helper::ResultSet::Shortcut::Page
9  DBIx::Class::ResultSet
10);
11
12sub limited_page {
13  my $self = shift;
14  if (@_ == 1) {
15    my $arg = shift;
16    if (ref $arg) {
17      my ( $page, $rows ) = @$arg{qw(page rows)};
18      return $self->page($page)->rows($rows);
19    } else {
20      return $self->page($arg);
21    }
22  } elsif (@_ == 2) {
23    my ( $page, $rows ) = @_;
24    return $self->page($page)->rows($rows);
25  } else {
26    die 'Invalid args passed to get_page method';
27  }
28}
29
301;
31
32__END__
33
34=pod
35
36=head1 NAME
37
38DBIx::Class::Helper::ResultSet::Shortcut::LimitedPage
39
40=head1 AUTHOR
41
42Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
43
44=head1 COPYRIGHT AND LICENSE
45
46This software is copyright (c) 2020 by Arthur Axel "fREW" Schmidt.
47
48This is free software; you can redistribute it and/or modify it under
49the same terms as the Perl 5 programming language system itself.
50
51=cut
52