« 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
| |||||||||||
| 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__ | ||||||||||