Bug 20473: Whitespace
[koha.git] / Koha / AudioAlert.pm
1 package Koha::AudioAlert;
2
3 # Copyright ByWater Solutions 2014
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20 use Modern::Perl;
21
22
23 use Koha::Database;
24
25 use base qw(Koha::Object);
26
27 =head1 NAME
28
29 Koha::AudioAlert - Koha Audio Alert object class
30
31 =head1 API
32
33 =head2 Class Methods
34
35 =head3 store
36
37 Override base store to set default precedence
38 if there is not one set already.
39
40 =cut
41
42 sub store {
43     my ($self) = @_;
44
45     $self->precedence( Koha::AudioAlerts->get_next_precedence() ) unless defined $self->precedence();
46
47     return $self->SUPER::store();
48 }
49
50 =head3 move
51
52 $alert->move('up');
53
54 Changes the alert's precedence up, down, top, or bottom
55
56 =cut
57
58 sub move {
59     my ( $self, $where ) = @_;
60
61     return Koha::AudioAlerts->move( { audio_alert => $self, where => $where } );
62 }
63
64 =head3 type
65
66 =cut
67
68 sub _type {
69     return 'AudioAlert';
70 }
71
72 =head1 AUTHOR
73
74 Kyle M Hall <kyle@bywatersolutions.com>
75
76 =cut
77
78 1;