@@ -, +, @@ --- Koha/Biblio.pm | 2 +- Koha/Recall.pm | 18 +++++++++++------- Koha/Schema/Result/Recall.pm | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -1164,7 +1164,7 @@ sub get_marc_host { =head3 recalls - my @recalls = $biblio->recalls; + my $recalls = $biblio->recalls; Return all active recalls attached to this biblio, sorted by oldest first --- a/Koha/Recall.pm +++ a/Koha/Recall.pm @@ -21,9 +21,10 @@ use Modern::Perl; use Koha::Database; use Koha::DateUtils qw( dt_from_string ); -use Koha::Patron; -use Koha::Biblio; -use Koha::Item; +use Koha::Biblios; +use Koha::Items; +use Koha::Libraries; +use Koha::Patrons; use base qw(Koha::Object); @@ -33,7 +34,7 @@ Koha::Recall - Koha Recall Object class =head1 API -=head2 Internal methods +=head2 Class methods =cut @@ -77,7 +78,7 @@ Returns the related Koha::Patron object for this recall. sub patron { my ( $self ) = @_; - my $patron_rs = $self->_result->borrower; + my $patron_rs = $self->_result->patron; return unless $patron_rs; return Koha::Patron->_new_from_dbic( $patron_rs ); } @@ -92,8 +93,9 @@ Returns the related Koha::Library object for this recall. sub library { my ( $self ) = @_; - $self->{_library} = Koha::Libraries->find( $self->branchcode ); - return $self->{_library}; + my $library_rs = $self->_result->library; + return unless $library_rs; + return Koha::Library->_new_from_dbic( $library_rs ); } =head3 checkout @@ -465,6 +467,8 @@ sub set_finished { return $self; } +=head2 Internal methods + =head3 _type =cut --- a/Koha/Schema/Result/Recall.pm +++ a/Koha/Schema/Result/Recall.pm @@ -293,14 +293,14 @@ __PACKAGE__->belongs_to( ); __PACKAGE__->belongs_to( - "borrower", + "patron", "Koha::Schema::Result::Borrower", { borrowernumber => "borrowernumber" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); __PACKAGE__->belongs_to( - "branch", + "library", "Koha::Schema::Result::Branch", { branchcode => "branchcode" }, { --