Preferences/Schema/ResultSet/PrfDefault.pm

filter: Statementstmt 37.9% 11 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 25.0% 3 / 12 Podpod 100% 9 / 9 totaltotal 46.0% 23 / 50 CC 1 SCAR 5.6
CC
1
Cov
38%
active
2.0
active_first
2.0
not_hidden
2.0
CRAP 1.8
« FB11X/Preferences.pm ↑ Summary Preferences/Hat/preferences.pm »
1  
2 package OpusVL::Preferences::Schema::ResultSet::PrfDefault;
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 extends 'DBIx::Class::ResultSet';
9  
10 sub active
11 0 ▶{
Subroutine active: not called CC=1 SCAR=6.9
Pod documented
12 0 my $self = shift;
13 0 return $self->search({ active => 1 }, {
14 order_by => ['name'], # just ensure we always have a consistent order
15 });
16 }
17  
18 sub active_first
19 0 ▶{
Subroutine active_first: not called CC=1 SCAR=6.9
Pod documented
20 0 my $self = shift;
21 0 return $self->search(undef, {
22 order_by => [ { -desc => ['active'] }, { -asc => ['display_order', 'name'] } ],
23 });
24 }
25  
26 sub not_hidden
27 0 ▶{
Subroutine not_hidden: not called CC=1 SCAR=6.9
Pod documented
28 0 my $self = shift;
29 0 return $self->search({ -or => [ hidden => 0, hidden => undef ] });
30 }
31  
32 sub display_order
33 0 ▶{
Subroutine display_order: not called CC=1 SCAR=6.9
Pod documented
34 0 my $self = shift;
35 0 return $self->search(undef, { order_by => [ 'display_order', 'name' ] } );
36 }
37  
38 sub display_on_search
39 0 ▶{
Subroutine display_on_search: not called CC=1 SCAR=6.9
Pod documented
40 0 my $self = shift;
41 0 return $self->search({ display_on_search => 1 });
42 }
43  
44 sub searchable
45 0 ▶{
Subroutine searchable: not called CC=1 SCAR=6.9
Pod documented
46 0 my $self = shift;
47 0 return $self->search({ searchable => 1 });
48 }
49  
50 sub for_search
51 0 ▶{
Subroutine for_search: not called CC=1 SCAR=6.9
Pod documented
52 0 my $self = shift;
53 0 return $self->active->display_on_search->display_order;
54 }
55  
56 sub for_search_criteria
57 0 ▶{
Subroutine for_search_criteria: not called CC=1 SCAR=6.9
Pod documented
58 0 my $self = shift;
59 0 return $self->active->searchable->display_order;
60 }
61  
62 sub for_report
63 0 ▶{
Subroutine for_report: not called CC=1 SCAR=6.9
Pod documented
64 0 my $self = shift;
65 0 return $self->active->not_hidden->display_order;
66 }
67  
68 1 return 1;
69  
70 =head1 DESCRIPTION
71  
72 =head1 METHODS
73  
74 =head2 active
75  
76 =head2 active_first
77  
78 =head2 not_hidden
79  
80 =head2 display_on_search
81  
82 =head2 for_search
83  
84 =head2 searchable
85  
86 =head2 for_search_criteria
87  
88 =head2 display_order
89  
90 Returns the preferences in the display order.
91  
92 =head2 for_report
93  
94 Returns a resultset ordered and filtered for use on the transaction report.
95  
96 =head1 ATTRIBUTES
97  
98  
99 =cut
« FB11X/Preferences.pm ↑ Summary Preferences/Hat/preferences.pm »