X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=Koha%2FAuthority.pm;h=ac2b25c310e10c10c22c559eba47388b85c9bc4d;hb=662a98345a71fb170bc6ae5b3679e3edf4eee96f;hp=b03737d59fed027f8d8cb74c793a0f33dba3c7f7;hpb=7cb660c665010c056e9e2c6ccddaebfdd3033a00;p=koha.git diff --git a/Koha/Authority.pm b/Koha/Authority.pm index b03737d59f..ac2b25c310 100644 --- a/Koha/Authority.pm +++ b/Koha/Authority.pm @@ -19,11 +19,8 @@ package Koha::Authority; use Modern::Perl; -use Carp; - -use Koha::Database; - use base qw(Koha::Object); +use Koha::SearchEngine::Search; =head1 NAME @@ -31,10 +28,39 @@ Koha::Authority - Koha Authority Object class =head1 API -=head2 Class Methods +=head2 Instance Methods + +=head3 get_usage_count + + $count = $self->get_usage_count; + + Returns the number of linked biblio records. =cut +sub get_usage_count { + my ( $self ) = @_; + return Koha::Authorities->get_usage_count({ authid => $self->authid }); +} + +=head3 linked_biblionumbers + + my @biblios = $self->linked_biblionumbers({ + [ max_results => $max ], [ offset => $offset ], + }); + + Returns an array of biblionumbers. + +=cut + +sub linked_biblionumbers { + my ( $self, $params ) = @_; + $params->{authid} = $self->authid; + return Koha::Authorities->linked_biblionumbers( $params ); +} + +=head2 Class Methods + =head3 type =cut