line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Search::Query::Field::SWISH; |
2
|
4
|
|
|
4
|
|
18
|
use Moo; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
22
|
|
3
|
|
|
|
|
|
|
extends 'Search::Query::Field'; |
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
902
|
use namespace::autoclean; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
35
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has 'type' => ( is => 'rw' ); |
8
|
|
|
|
|
|
|
has 'is_int' => ( is => 'rw' ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.307'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Search::Query::Field::SWISH - query field representing a Swish MetaName |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $field = Search::Query::Field::SWISH->new( |
19
|
|
|
|
|
|
|
name => 'foo', |
20
|
|
|
|
|
|
|
alias_for => [qw( bar bing )], |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Search::Query::Field::SWISH implements field |
26
|
|
|
|
|
|
|
validation and aliasing in SWISH search queries. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 METHODS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This class is a subclass of Search::Query::Field. Only new or overridden |
31
|
|
|
|
|
|
|
methods are documented here. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 BUILD |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Available params are also standard attribute accessor methods. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=over |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item type |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
The column type.a |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item is_int |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Set if C matches m/int|num|date/. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=back |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub BUILD { |
52
|
26
|
|
|
26
|
1
|
4154
|
my $self = shift; |
53
|
|
|
|
|
|
|
|
54
|
26
|
|
100
|
|
|
107
|
$self->{type} ||= 'char'; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# numeric types |
57
|
26
|
100
|
|
|
|
102
|
if ( $self->{type} =~ m/int|date|num/ ) { |
58
|
1
|
|
|
|
|
16
|
$self->{is_int} = 1; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# text types |
62
|
|
|
|
|
|
|
else { |
63
|
25
|
|
|
|
|
445
|
$self->{is_int} = 0; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |