<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Arial",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.E-mailStijl17
        {mso-style-type:personal-compose;
        font-family:"Arial",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NL" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi devs,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am seeing more Koha objects that include methods for related records like Koha::Patron, sub image referring to Koha::Patron::Images.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">As a second example, on bug 14610 (article requests), a biblio, item, branch and borrower method is added to Koha::ArticleRequest.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Obviously, they all follow the same pattern.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Could we generalize that, and keep our code cleaner?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">And do we always need the full Koha object? For use in a template we may need only a few columns.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In other cases we have added a sort of wrapper like Branches.GetName from the Branches plugin.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am interested to know if we want to enforce this wrapper approach for instance, or just continue on the current road.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thx,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Marcel<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>