| 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 | { | ||
| 12 | 0 | ▶ | my $self = shift; |
|
Subroutine
active: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 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 | { | ||
| 20 | 0 | ▶ | my $self = shift; |
|
Subroutine
active_first: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 21 | 0 | return $self->search(undef, { | |
| 22 | order_by => [ { -desc => ['active'] }, { -asc => ['display_order', 'name'] } ], | ||
| 23 | }); | ||
| 24 | } | ||
| 25 | |||
| 26 | sub not_hidden | ||
| 27 | { | ||
| 28 | 0 | ▶ | my $self = shift; |
|
Subroutine
not_hidden: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 29 | 0 | return $self->search({ -or => [ hidden => 0, hidden => undef ] }); | |
| 30 | } | ||
| 31 | |||
| 32 | sub display_order | ||
| 33 | { | ||
| 34 | 0 | ▶ | my $self = shift; |
|
Subroutine
display_order: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 35 | 0 | return $self->search(undef, { order_by => [ 'display_order', 'name' ] } ); | |
| 36 | } | ||
| 37 | |||
| 38 | sub display_on_search | ||
| 39 | { | ||
| 40 | 0 | ▶ | my $self = shift; |
|
Subroutine
display_on_search: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 41 | 0 | return $self->search({ display_on_search => 1 }); | |
| 42 | } | ||
| 43 | |||
| 44 | sub searchable | ||
| 45 | { | ||
| 46 | 0 | ▶ | my $self = shift; |
|
Subroutine
searchable: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 47 | 0 | return $self->search({ searchable => 1 }); | |
| 48 | } | ||
| 49 | |||
| 50 | sub for_search | ||
| 51 | { | ||
| 52 | 0 | ▶ | my $self = shift; |
|
Subroutine
for_search: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 53 | 0 | return $self->active->display_on_search->display_order; | |
| 54 | } | ||
| 55 | |||
| 56 | sub for_search_criteria | ||
| 57 | { | ||
| 58 | 0 | ▶ | my $self = shift; |
|
Subroutine
for_search_criteria: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 59 | 0 | return $self->active->searchable->display_order; | |
| 60 | } | ||
| 61 | |||
| 62 | sub for_report | ||
| 63 | { | ||
| 64 | 0 | ▶ | my $self = shift; |
|
Subroutine
for_report: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 65 | 0 | return $self->active->not_hidden->display_order; | |
| 66 | } | ||
| 67 | |||
| 68 | 1 | return 1; | |
| 69 | |||
| 70 | __END__ | ||
| 71 | |||
| 72 | =pod | ||
| 73 | |||
| 74 | =encoding UTF-8 | ||
| 75 | |||
| 76 | =head1 NAME | ||
| 77 | |||
| 78 | OpusVL::Preferences::Schema::ResultSet::PrfDefault | ||
| 79 | |||
| 80 | =head1 VERSION | ||
| 81 | |||
| 82 | version 0.24 | ||
| 83 | |||
| 84 | =head1 DESCRIPTION | ||
| 85 | |||
| 86 | =head1 METHODS | ||
| 87 | |||
| 88 | =head2 active | ||
| 89 | |||
| 90 | =head2 active_first | ||
| 91 | |||
| 92 | =head2 not_hidden | ||
| 93 | |||
| 94 | =head2 display_on_search | ||
| 95 | |||
| 96 | =head2 for_search | ||
| 97 | |||
| 98 | =head2 searchable | ||
| 99 | |||
| 100 | =head2 for_search_criteria | ||
| 101 | |||
| 102 | =head2 display_order | ||
| 103 | |||
| 104 | Returns the preferences in the display order. | ||
| 105 | |||
| 106 | =head2 for_report | ||
| 107 | |||
| 108 | Returns a resultset ordered and filtered for use on the transaction report. | ||
| 109 | |||
| 110 | =head1 ATTRIBUTES | ||
| 111 | |||
| 112 | =head1 AUTHOR | ||
| 113 | |||
| 114 | OpusVL - www.opusvl.com | ||
| 115 | |||
| 116 | =head1 COPYRIGHT AND LICENSE | ||
| 117 | |||
| 118 | This software is copyright (c) 2011 by OpusVL - www.opusvl.com. | ||
| 119 | |||
| 120 | This is free software; you can redistribute it and/or modify it under | ||
| 121 | the same terms as the Perl 5 programming language system itself. | ||
| 122 | |||
| 123 | =cut | ||