Bug 18789: (follow-up) Send Koha::Patron object to the templates
[koha.git] / Koha / Authority.pm
1 package Koha::Authority;
2
3 # Copyright 2015 Koha Development Team
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 3 of the License, or (at your option) any later
10 # version.
11 #
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20 use Modern::Perl;
21
22 use base qw(Koha::Object);
23 use Koha::SearchEngine::Search;
24
25 =head1 NAME
26
27 Koha::Authority - Koha Authority Object class
28
29 =head1 API
30
31 =head2 Instance Methods
32
33 =head3 get_usage_count
34
35     $count = $self->get_usage_count;
36
37     Returns the number of linked biblio records.
38
39 =cut
40
41 sub get_usage_count {
42     my ( $self ) = @_;
43     return Koha::Authorities->get_usage_count({ authid => $self->authid });
44 }
45
46 =head3 linked_biblionumbers
47
48     my @biblios = $self->linked_biblionumbers({
49         [ max_results => $max ], [ offset => $offset ],
50     });
51
52     Returns an array of biblionumbers.
53
54 =cut
55
56 sub linked_biblionumbers {
57     my ( $self, $params ) = @_;
58     $params->{authid} = $self->authid;
59     return Koha::Authorities->linked_biblionumbers( $params );
60 }
61
62 =head2 Class Methods
63
64 =head3 type
65
66 =cut
67
68 sub _type {
69     return 'AuthHeader';
70 }
71
72 1;