Bug 25996: Make AddDebarment() use Koha::Patron::Restriction
This patch makes the AddDebarment() method use the Koha::Object-based
class to ease the next steps. The current codebase makes the feature
fragile otherwise, as adding a new row and then querying for the latest
row of that kind seems risky,
With this approach the result is the same, but we have the
Koha::Patron::Restriction object for using it later in logging.
I opted to return 1 as it does now. The whole module deserves to be
removed in the future but it is out of the scope of this report.
To test:
1. Run:
$ ktd --shell
k$ prove t/db_dependent/Patron/Borrower_Debarments.t
=> SUCCESS: Tests pass
2. Apply this tiny refactoring patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D
Sponsored-by: Karlsruhe Institute of Technology (KIT) Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>