Bug 20443: Improve filtering method
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 13 Jul 2018 15:10:47 +0000 (12:10 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 23 Mar 2020 13:44:00 +0000 (13:44 +0000)
commit52949f88e0110e52b965bedbdcb885bdb5b00eaf
treed6a4fc8b17e320c52a89e5bab1f6b1ab3164cc91
parent9707167a482894f270549ae9633eaef980f1ed35
Bug 20443: Improve filtering method

Koha::Patron::Attributes->search mimicks what is done in
Koha::AuthorisedValues->search.
But actually it should be more explicit when the caller use it.
For instance filter_by_branch_limitation (see discussion on bug 11983).

This will be useful for the following patches as we will need a way to
replace the $no_branch_limit flag.
When the $no_branch_limit flag is called, a simple ->search call should
be done.
When we want to limit on a specific library we can pass the branchcode
in paramter of filter_by_branch_limitation (this is not used yet).
If not passed the logged-in user library will be used by default.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Patron/Attributes.pm
t/db_dependent/Koha/Patrons.t