| 1 | package DBIx::Class::Helper::ResultSet::Shortcut::Search::Base; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 57 | $DBIx::Class::Helper::ResultSet::Shortcut::Search::Base::VERSION = '2.037000'; | |||||||||||||||||||||||||||||||||||||||||
| 3 | 57 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 57 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 57 | ▶ | use parent 'DBIx::Class::ResultSet'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | #--------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||
| 9 | # _helper_unwrap_columns(@columns) | ||||||||||||||||||||||||||||||||||||||||||
| 10 | #--------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 7 | ▶ | sub _helper_unwrap_columns { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_helper_unwrap_columns: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 7 | my ($self, @columns) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 7 | ▶ | if (@columns == 1 && ref($columns[0]) && ref($columns[0]) eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
@columns == 1 and ref $columns[0] and ref $columns[0] eq "ARRAY"
@columns == 1 and ref $columns[0]
MC/DC66%2/3
@columns == 1 and ref $columns[0] and ref $columns[0] eq "ARRAY"
@columns == 1
ref $columns[0]
ref $columns[0] eq "ARRAY"
Truth table75%3/4
A and B and C
A= @columns == 1B= ref $columns[0]C= ref $columns[0] eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | @columns = @{ $columns[0] }; | |||||||||||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 7 | return @columns; | |||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | #--------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||
| 23 | # _helper_meify($column) | ||||||||||||||||||||||||||||||||||||||||||
| 24 | #--------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 8 | ▶ | sub _helper_meify { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_helper_meify: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 8 | my ($self, $column) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 8 | ▶ | return $self->current_source_alias . $column if $column =~ m/^\./; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 6 | return $column; | |||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | #--------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||
| 34 | # _helper_apply_search($cond, @columns) | ||||||||||||||||||||||||||||||||||||||||||
| 35 | #--------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 5 | ▶ | sub _helper_apply_search { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_helper_apply_search: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 5 | my ($self, $cond, @columns) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 5 | @columns = $self->_helper_unwrap_columns(@columns); | |||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | 5 | my $rs = $self; | |||||||||||||||||||||||||||||||||||||||||
| 43 | 5 | foreach my $column (@columns) { | |||||||||||||||||||||||||||||||||||||||||
| 44 | 6 | $rs = $rs->search_rs({ $self->_helper_meify($column) => $cond }); | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 5 | return $rs; | |||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 57 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | __END__ | ||||||||||||||||||||||||||||||||||||||||||