line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Class::Helper::ResultSet::Shortcut::Search::Base; |
2
|
|
|
|
|
|
|
$DBIx::Class::Helper::ResultSet::Shortcut::Search::Base::VERSION = '2.036000'; |
3
|
57
|
|
|
57
|
|
26841
|
use strict; |
|
57
|
|
|
|
|
140
|
|
|
57
|
|
|
|
|
1494
|
|
4
|
57
|
|
|
57
|
|
294
|
use warnings; |
|
57
|
|
|
|
|
127
|
|
|
57
|
|
|
|
|
1483
|
|
5
|
|
|
|
|
|
|
|
6
|
57
|
|
|
57
|
|
353
|
use parent 'DBIx::Class::ResultSet'; |
|
57
|
|
|
|
|
133
|
|
|
57
|
|
|
|
|
503
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#--------------------------------------------------------------------------# |
9
|
|
|
|
|
|
|
# _helper_unwrap_columns(@columns) |
10
|
|
|
|
|
|
|
#--------------------------------------------------------------------------# |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _helper_unwrap_columns { |
13
|
7
|
|
|
7
|
|
94
|
my ($self, @columns) = @_; |
14
|
|
|
|
|
|
|
|
15
|
7
|
100
|
100
|
|
|
85
|
if (@columns == 1 && ref($columns[0]) && ref($columns[0]) eq 'ARRAY') { |
|
|
|
66
|
|
|
|
|
16
|
2
|
|
|
|
|
16
|
@columns = @{ $columns[0] }; |
|
2
|
|
|
|
|
13
|
|
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
7
|
|
|
|
|
53
|
return @columns; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#--------------------------------------------------------------------------# |
23
|
|
|
|
|
|
|
# _helper_meify($column) |
24
|
|
|
|
|
|
|
#--------------------------------------------------------------------------# |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _helper_meify { |
27
|
8
|
|
|
8
|
|
32
|
my ($self, $column) = @_; |
28
|
|
|
|
|
|
|
|
29
|
8
|
100
|
|
|
|
81
|
return $self->current_source_alias . $column if $column =~ m/^\./; |
30
|
6
|
|
|
|
|
63
|
return $column; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#--------------------------------------------------------------------------# |
34
|
|
|
|
|
|
|
# _helper_apply_search($cond, @columns) |
35
|
|
|
|
|
|
|
#--------------------------------------------------------------------------# |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _helper_apply_search { |
38
|
5
|
|
|
5
|
|
56
|
my ($self, $cond, @columns) = @_; |
39
|
|
|
|
|
|
|
|
40
|
5
|
|
|
|
|
49
|
@columns = $self->_helper_unwrap_columns(@columns); |
41
|
|
|
|
|
|
|
|
42
|
5
|
|
|
|
|
27
|
my $rs = $self; |
43
|
5
|
|
|
|
|
34
|
foreach my $column (@columns) { |
44
|
6
|
|
|
|
|
293
|
$rs = $rs->search_rs({ $self->_helper_meify($column) => $cond }); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
5
|
|
|
|
|
3082
|
return $rs; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=pod |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 NAME |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
DBIx::Class::Helper::ResultSet::Shortcut::Search::Base |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is copyright (c) 2020 by Arthur Axel "fREW" Schmidt. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
70
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |