[Koha-bugs] [Bug 18182] TestBuilder should be able to return Koha::Object objects

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 6 17:08:20 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182

--- Comment #6 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Marcel de Rooy from comment #5)
> (In reply to Tomás Cohen Arazi from comment #4)
> > Singular classes are not aware of the plural class name. And we need the
> > plural to ->find the created object. That's the design decision I don't like
> > about koha::object(s). I'm open to opinions, but the only solutions are
> > -annotate singular classes so they know their plural
> > -move the plural methods to the singular classes and get rid of plural
> > 
> > I vote for the latter, of course. But that would be a bigger dev.
> 
> Did you look at this one: sub _get_objects_class
> $ git grep koha_objects_class
> Koha/Objects.pm:    if( $type->can('koha_objects_class') ) {
> Koha/Objects.pm:        return $type->koha_objects_class;
> Koha/Schema/Result/Borrower.pm:sub koha_objects_class {
> Koha/Schema/Result/Branch.pm:sub koha_objects_class {
> Koha/Schema/Result/OldIssue.pm:sub koha_objects_class {
> 
> So cool :)

So we annotate our singular classes.

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


More information about the Koha-bugs mailing list