Pager/Logic/MySQLFoundRows.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 92.5% 25 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Pager/ResultSet.pm ↑ Summary Pager/Page.pm »
1 package DBIx::Skinny::Pager::Logic::MySQLFoundRows;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use base qw/DBIx::Skinny::Pager/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use Data::Page;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶sub as_sql {
Subroutine as_sql: called CC=1 SCAR=0.0
Pod undocumented
8 5 my $self = shift;
9 5 my $result = $self->SUPER::as_sql;
10 # TODO: 正規表現もいいかげんなのでもうちょいちゃんとやりたい
11 # as_sqlの中身をいじるのは本家への追従を考えると難しそう
12 5 $result =~ s/SELECT /SELECT SQL_CALC_FOUND_ROWS /; # mysql support only
13 5 $result;
14 }
15  
16 3 ▶sub get_total_entries {
Subroutine get_total_entries: called CC=1 SCAR=0.0
Pod undocumented
17 3 my $self = shift;
18 3 $self->skinny->search_by_sql(q{SELECT FOUND_ROWS() AS row})->first->row;
19 }
20  
21 5 1;
22 __END__
« Pager/ResultSet.pm ↑ Summary Pager/Page.pm »