<div dir="ltr"><div>Hi Frido,</div><div><br></div><div>On 26407 we must use an arrayref as we searched on the same attribute, but otherwise both syntax are identical.</div><div><br></div><div>Koha::Patrons->search({ -or => { surname => 'koha', firstname => 'koha' } })</div><div>Koha::Patrons->search({ -or => [ surname => 'koha', firstname => 'koha' ] })</div><div>Koha::Patrons->search([ surname => 'koha', firstname => 'koha' ])</div><div>Will generate the same query.</div><div><br></div><div>Same for:</div><div>Koha::Patrons->search({ -and => { surname => 'koha', firstname => 'koha' } })<br>Koha::Patrons->search({ -and => [ surname => 'koha', firstname => 'koha' ] })<br>Koha::Patrons->search({ surname => 'koha', firstname => 'koha' })</div><div><br></div><div>See also <a href="https://metacpan.org/pod/SQL::Abstract::Classic#WHERE-CLAUSES">https://metacpan.org/pod/SQL::Abstract::Classic#WHERE-CLAUSES</a></div><div><br></div><div>Cheers,</div><div>Jonathan<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 3 nov. 2020 à 09:02, Fridolin SOMERS <<a href="mailto:fridolin.somers@biblibre.com">fridolin.somers@biblibre.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I recently changed a call on Koha::Biblios->search() to use an arrayref <br>
instead of hashref :<br>
<a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26407" rel="noreferrer" target="_blank">https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26407</a><br>
<br>
But I see there are both arrayref of hashref existing in code for "-or" <br>
query.<br>
<br>
What is the difference ?<br>
Is there a way we should choose in guidelines ?<br>
<br>
Best regards,<br>
<br>
-- <br>
Fridolin SOMERS <<a href="mailto:fridolin.somers@biblibre.com" target="_blank">fridolin.somers@biblibre.com</a>><br>
Software and system maintainer 🦄<br>
BibLibre, France<br>
_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
<a href="https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a><br>
</blockquote></div>