line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Search::QS::Options::Sort; |
2
|
|
|
|
|
|
|
$Search::QS::Options::Sort::VERSION = '0.03'; |
3
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
95
|
|
4
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
80
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
16
|
use Moose; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
16
|
|
7
|
4
|
|
|
4
|
|
21069
|
use Moose::Util::TypeConstraints; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
30
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: A sort element |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
enum 'direction_types', [qw( asc desc )]; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has name => ( is => 'rw', isa => 'Str'); |
15
|
|
|
|
|
|
|
has direction => ( is => 'rw', isa => 'direction_types', default => 'asc'); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub to_qs() { |
18
|
5
|
|
|
5
|
1
|
156
|
my $s = shift; |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
|
|
112
|
return 'sort[' . $s->name . ']=' . $s->direction; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
4
|
|
7851
|
no Moose; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
18
|
|
25
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=encoding UTF-8 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Search::QS::Options::Sort - A sort element |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 VERSION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
version 0.03 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 DESCRIPTION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
This object incapsulate a single sort item. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 METHODS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 name() |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
The field to sort |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 direction() |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
The type of sort (asc|desc) |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 to_qs() |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Return a query string of the internal rappresentation of the object |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Emiliano Bruni <info@ebruni.it> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is copyright (c) 2019 by Emiliano Bruni. |
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 |