[Koha-bugs] [Bug 13851] Replace waiting holds logic in circulation.pl with Koha Objects
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Jul 31 18:22:34 CEST 2015
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13851
Olli-Antti Kivilahti <olli-antti.kivilahti at jns.fi> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |olli-antti.kivilahti at jns.fi
--- Comment #22 from Olli-Antti Kivilahti <olli-antti.kivilahti at jns.fi> ---
Hi there!
Tomás asked me to comment on this.
I have nothing major to complain, all looks good to me.
I spotted one optimization however:
+++ b/Koha/Hold.pm
+sub biblio {
+ my ($self) = @_;
+
+ $self->{_biblio} ||= Koha::Biblios->find( $self->biblionumber() );
+
+ return $self->{_biblio};
+}
When you get the linked object like this 'Koha::Biblios->find()', you need to
instantiate a new DBIx::Class::ResultSet to make the search. There is already
an instantiated resultset in Koha::Hold (the caller class).
Should we instead get the linked data like this?
#The relationship is already defined in the DBIx::Schema
my $b = $self->_resultset()->biblio()
$b = $self->_new_from_dbic($b);
using the DBIx::Schema's preconfigured relationships?
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list