[Koha-bugs] [Bug 13019] Add base classes on which to build Koha objects

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Nov 12 15:23:28 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13019

--- Comment #26 from M. de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Jonathan Druart from comment #25)
Please be assured that I appreciate your work and eagerness to get things into
Koha. I also know that it can be somewhat frustrating to see things develop
rather slow. Since this is meant to be a very fundamental object, I would not
recommend hurry here btw.

> Yes of course. We will only add methods in Koha::Object[s] if needed and
> make sense.
This sounds like a misunderstanding. If it would be so obvious to not have DBIx
code in a perl script (or unit test!), why does Borrower.t contain constructs
like: 
my $borrower = Koha::Database->new()->schema()->resultset('Borrower')->find(
$borrowernumber );

Just replace it by something like Koha::Borrower->find( $borrowernumber ) or
even extend new with similar functionality, as commented before. This would
make new_from_dbic as external method (!! -- could be private though with an
underscore) and passing resultsets superfluous. Leave the result set stuff in
the objects.

Also note that Koha::Borrowers->new()->find is not really elegant. Why not
offer both Koha::Borrower->find and Koha::Borrowers->find without going through
new?

With some minimal changes in that direction, I would be inclined to pass qa..

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list