lib/DBIx/Class/Helper/ResultSet/Shortcut/Search/IsAny.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 29 / 29 CC 3 SCAR 6.9
CC
3
Cov
100%
is_any
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« lib/DBIx/Class/Helper/ResultSet/Shortcut/Search/BlankOrNull.pm ↑ Summary lib/DBIx/Class/Helper/ResultSet/Shortcut/Search/NotBlankOrNull.pm »
1 package DBIx::Class::Helper::ResultSet::Shortcut::Search::IsAny;
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 parent 'DBIx::Class::Helper::ResultSet::Shortcut::Search::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 2 ▶sub is_any {
Subroutine is_any: called CC=3 SCAR=11.0
Pod documented
8 2 my ( $self, @columns ) = @_;
9 2 $self->load_components(qw{Helper::ResultSet::SetOperations});
10 2 ▶ if ( !ref $columns[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not ref $columns[0]) { } 1 1 2
11 1 $self->throw_exception( 'Why would you only send one column to is_any?' );
12 }
13 else {
14 1 my @rs_array;
15 1 my $i = 0;
16 1 foreach my $column ( @{ $columns[0] } ) {
17 2 $rs_array[$i] = $self->_helper_apply_search( { '=' => 'true' }, $column );
18 2 $i++;
19 }
20 1 my $result = shift @rs_array;
21 1 return $result->union( \@rs_array );
22 }
23 }
24  
25 5 1;
26  
27 __END__
« lib/DBIx/Class/Helper/ResultSet/Shortcut/Search/BlankOrNull.pm ↑ Summary lib/DBIx/Class/Helper/ResultSet/Shortcut/Search/NotBlankOrNull.pm »