Hi devs,

I am seeing more Koha objects that include methods for related records like 
Koha::Patron, sub image referring to Koha::Patron::Images.
As a second example, on bug 14610 (article requests), a biblio, item, branch 
and borrower method is added to Koha::ArticleRequest.
Obviously, they all follow the same pattern.
Could we generalize that, and keep our code cleaner?

And do we always need the full Koha object? For use in a template we may need 
only a few columns.
We start passing these objects to the templates now too, making it possible to 
call methods from the template. It is possible, but do we really want that? 
More code ends up in the template, maybe harder to find since you now use 
borrower.method instead of borrower->method etc. Secondly, reading 
borrower.something might not immediately tell you that something is a method 
instead of a column.
In other cases we have added a sort of wrapper like Branches.GetName from the 
Branches plugin.
I am interested to know if we want to enforce this wrapper approach for 
instance, or just continue on the current road.

Thx,

Marcel

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to