3771acfb980776ae18d2c9c13138bcb24f61ba57
[koha.git] / Koha / SMS / Provider.pm
1 package Koha::SMS::Provider;
2
3 # Copyright ByWater Solutions 2016
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::Patrons;
24
25 use base qw(Koha::Object);
26
27 =head1 NAME
28
29 Koha::Biblio - Koha Biblio Object class
30 Koha::SMS::Provider - Koha SMS Provider object class
31
32 =head1 API
33
34 =head2 Class Methods
35
36 =cut
37
38 =head3 patrons_using
39
40 my $count = $provider->patrons_using()
41
42 Gives the number of patrons using this provider
43
44 =cut
45
46 sub patrons_using {
47     my ( $self ) = @_;
48
49     return Koha::Patrons->search( { sms_provider_id => $self->id } )->count();
50 }
51
52 =head3 _type
53
54 =cut
55
56 sub _type {
57     return 'SmsProvider';
58 }
59
60 =head1 AUTHOR
61
62 Kyle M Hall <kyle@bywatersolutions.com>
63
64 =cut
65
66 1;