Mixin/SearchWithPager.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 2 totaltotal 48.3% 15 / 31 CC 3 SCAR 17.4
CC
3
Cov
46%
search_with_pager
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« Pager/Logic/Count.pm ↑ Summary Pager.pm »
1 package DBIx::Skinny::Mixin::SearchWithPager;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use UNIVERSAL::require;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶sub register_method {
Subroutine register_method: called CC=1 SCAR=0.0
Pod undocumented
7 +{
8 2 'search_with_pager' => \&search_with_pager,
9 };
10 }
11  
12 0 ▶sub search_with_pager {
Subroutine search_with_pager: not called CC=3 SCAR=24.8
Pod undocumented
13 0 my ($class, $table, $where_cnd, $option_cnd, ) = @_;
14 0 my $pager_logic = delete $option_cnd->{pager_logic};
15 0 my $page = delete $option_cnd->{page};
16 0 my $rs = $class->search_rs($table, $where_cnd, $option_cnd);
17 0 my $logic_class = "DBIx::Skinny::Pager::Logic::$pager_logic";
18 0 ▶ $logic_class->require
Branch: 1 branch
BranchTrueFalseTotal
$logic_class->require or die $@ 0 0 0
19 or die $@;
20 0 bless $rs, $logic_class; # rebless resultset.
21 0 ▶ $rs->page($page) if $page;
Branch: 1 branch
BranchTrueFalseTotal
if $page 0 0 0
22 0 $rs->retrieve();
23 }
24  
25 3 1;
26  
27 __END__
« Pager/Logic/Count.pm ↑ Summary Pager.pm »